开发者

UIImageView's CALayer's anchorPoint "accessing unknown component of property" error

开发者 https://www.devze.com 2022-12-15 23:06 出处:网络
I\'m trying to rotate an image about the bottom right corner. To do this I know I need to set the layer\'s anchorPoint, but I can\'t access it. I\'ve included the QuartzCore framework in my project. T

I'm trying to rotate an image about the bottom right corner. To do this I know I need to set the layer's anchorPoint, but I can't access it. I've included the QuartzCore framework in my project. To simplify the problem as much as possible, I've reduced the method to these three lines, which still throw the error "error: accessing unknown 'anchorPoint' component of a property" (line 2).

UIView *sqView = [[UIView alloc] init];
sqView.layer.anchorPoint = CGPointMake(1.0, 1.0);
[sqView release];

It must be something truly stupid. I've looked at other examples of this and they appear identical. What am I m开发者_Python百科issing?


have you added

#import <QuartzCore/QuartzCore.h>
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号