Question

I have one interesting problem.

I have view (UIView) A with subview A.1, A.2,... Above that I have another view (UIView) B. I need it to be B above A (because some view from A dissapear beneath view B).

What I need is to be only one subview from view A (for example A.1) above view B.

Is there a way to lift subview above another view so that all other view stays beneath?

Was it helpful?

Solution

No you can't do that... if you bringSubviewToFront A then its all subviews are showing above on B.

In that case you have to hidden subview which you dont want to see.

You can use below methods to for showing A on top.

[A.superview bringSubviewToFront:A];

Or you can put B below A with this method.

[B.superview sendSubviewToBack:B];

OTHER TIPS

Yes you can do it using those two functions:

[self bringSubviewToFront:view];
[self sendSubviewToBack:view];

In manipulates Z-index of your view.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top