Reputation:
Imagine that control a is under control b
how to change it to state that control b is under control a ?(from code)
Upvotes: 0
Views: 118
Reputation: 35925
I would use - [UIView exchangeSubviewAtIndex:withSubviewAtIndex:]
. As long as you know the indicies of A and B it will swap their positions in the superview's subview stack. This could give you better results than moving one to the extreme front or back of the superview, as there could be other views that might interfere.
Upvotes: 1
Reputation: 25318
[containerView bringSubviewToFront:controlA];
Where containerView
is obviously the view that has control a und b as subviews.
Upvotes: 1