Вопрос

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