I would like to create some custom toolbars using some of the images I also use for the iOS Tab Bar. How do I highlight icons like Apple does on the Tab Bar?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Note that I haven’t personally done this, but it is what I would do had I the need and time.
The
UIToolBarseems to achieve the effect using 3 layers:The bottom and second layer can both be pre-rendered images made to suit arbitrary dimensions using
[UIImage stretchableImageWithLeftCapWidth::].To apply the topmost layer’s alpha channel to the second layer, draw the topmost layer on to the second layer’s image using
UIContextDrawImagewith blend mode ofkCGBlendModeSourceIn. Then composite the result on top of the bottom most layer image and you should have something like whatUIToolBarrenders.