0

I'm now doing an application, where i need to put some elements in the top of the views sometimes.

For example, how could i do to make the entire CGRect red and not the green visible here :

example

Could i call addSubview method more than one time, and it won't be sad in memory management ?

Because i've tried a lot of things, like :

[myUIImageView removeFromSuperview];
[muUIVew addsubview:myUIImageView];

or :

[myUIImageView didMoveToSuperview];

But it gaves me an error... Thank you !

4

1 回答 1

1

不,你应该打电话addSubview一次。有管理子视图位置的方法。

这是您可以使用的两种方法:

[muUIVew sendSubviewToBack: myUIImageView];

[muUIVew bringSubviewToFront: myUIImageView];

应该很清楚他们做了什么。

于 2013-06-13T22:14:19.610 回答