user409333
user409333

Reputation:

to turn upside down control

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

Answers (2)

fbrereto
fbrereto

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

JustSid
JustSid

Reputation: 25318

[containerView bringSubviewToFront:controlA];

Where containerView is obviously the view that has control a und b as subviews.

Upvotes: 1

Related Questions