![](/img/trans.png)
[英]IOS/Objective-C: Hide subviews of view in UITableViewCell
[英]Objective-c adding Subviews to the bottom of view
有没有办法在其视图的“底部”添加子视图,如使用图层时z = 0? 我需要这个,因为当我产生物体时,它们需要在另一张照片下,而不是在上面。
UIView的子视图的排序方式是数组的最后一个是最前面的一个,然后是第一个(索引0)是后面的那个。 所以,要将它插入“底部”,这样就足够了:
[view insertSubview:aView atIndex:0]
当然 - 只需添加新视图并使用容器视图的sendSubviewToBack:方法。
sendSubviewToBack:
Moves the specified subview so that it appears behind its siblings.
- (void)sendSubviewToBack:(UIView *)view
来源: http : //developer.apple.com/library/IOs/#documentation/UIKit/Reference/UIView_Class/UIView/UIView.html
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.