I’ve got several UI elements on my screen (programmatically) and am in need of an efficient way to give each subview a z-index setting, so I can stack certain elements over others.
Does anyone have a solution to this?
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.
The plain
-addSubview:method will add the new view on top of its siblings.There are also a bunch of methods like
bringSubviewToFront:,insertSubview:belowSubview:, etc. that you can use to manipulate the ordering, listed under “Managing the View Hierarchy” in the UIView Reference