CALayer autoresizingMask not for iOS SDK?

会有一股神秘感。 提交于 2019-12-23 08:10:08

问题


I noticed, what CALayer, on iOS SDK haven't autoresizingMask property. I'm not sure what custom overloading of method "setFrame:" can work normally with animated sublayers autoresizing. Are there is an alternative without using UIView?


回答1:


You can use layoutSublayers function of calayer.




回答2:


If you do not want to subclass CALayer and added the layer to the layer of a UIView then you can override

- (void)layoutSublayersOfLayer:(CALayer *)layer

method of view.



来源:https://stackoverflow.com/questions/8600826/calayer-autoresizingmask-not-for-ios-sdk

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!