问题
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