Reputation: 12954
I'm doing a bit of UIView wrangling and am stuck. It is straightforward changing the "z" order of sibling subviews. [mySuperview sendSubviewToBack:mySubview] places mySubview behind all it's siblings.
But how do I place a subview behind it's parent?
Thanks, Doug
Upvotes: 4
Views: 7512
Reputation: 75077
You may want to put both into a container view, so that you can properly place one behind the other without affecting a superview not really meant to hold arbitrary views (although that will probably work just fine).
Upvotes: 2
Reputation: 4445
You can't as far as I know. You'll have to remove it from the parent then add it to the parent's parent's subviews.
UIView *parent = view.superview;
[view removeFromSuperview];
/* Adjust frame to realign under parent view */
[parent.superview addSubview:view];
Upvotes: 3