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?

有帮助吗?

解决方案

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];

其他提示

Yes you can do it using those two functions:

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

In manipulates Z-index of your view.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top