Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ios change subview index runtime

i intend to do some menu with tabs,

if I have the tabs ordered with z index, and i insert each tab with:

insertSubview:(UIView *) atIndex:(NSInteger)

and by pressing a button on top of them I want to change the tab shown, on top

how can I change the subview index at runtime?

thanks!

like image 671
manuelBetancurt Avatar asked Feb 14 '12 10:02

manuelBetancurt


1 Answers

sendSubviewToBack: and bringSubviewToFront: are the methods you are looking for. Another possibility is exchangeSubviewAtIndex:withSubviewAtIndex: if you want to exchange the layer of two views.

like image 151
JustSid Avatar answered Oct 12 '22 23:10

JustSid