UIView. How to place a preview under parental supervision

I am making the battle against UIView and getting stuck. This is a direct reordering of the "z" siblings. [mySuperview sendSubviewToBack: mySubview] puts mySubview behind all its siblings.

But how to place a subset of the parent behind it?

Thanks Doug

+3
source share
2 answers

You might want both of them to appear as a container, so you can correctly place them one by one without affecting the supervisor, which is not designed to store arbitrary views (although this will probably work fine).

+2
source

, . , .

UIView *parent = view.superview;
[view removeFromSuperview];

/* Adjust frame to realign under parent view */

[parent.superview addSubview:view];
+3

Source: https://habr.com/ru/post/1719058/


All Articles