我有一个UIView
,它有大约8个不同的CALayer
子层添加到它的层上.
如果是I modify the view's bounds(动画),则视图本身会缩小(我用backgroundColor
进行了判断),但是是the sublayers' size remains unchanged.
如何解决这个问题?
我有一个UIView
,它有大约8个不同的CALayer
子层添加到它的层上.
如果是I modify the view's bounds(动画),则视图本身会缩小(我用backgroundColor
进行了判断),但是是the sublayers' size remains unchanged.
如何解决这个问题?
我使用了索林使用的方法,但代码中有一个输入错误.方法应该是:
- (void)layoutSubviews {
[super layoutSubviews];
// resize your layers based on the view's new bounds
mylayer.frame = self.bounds;
}
出于我的目的,我一直希望子层是父视图的完整大小.将该方法放入视图类中.