문제

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