All,
This is probably very basic, but I cannot find an answer that works for me.
Simple enough -- I want to rotate an image around an endpoint, not the center. I know that all I really need is to be able to set the anchor point of the image and then apply the transform.
I cannot, however, figure out how to set the anchor point of the image (or should it be an UIImageView?)
UIImageView * imgv = nil;
UIImage * image;
imgv = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"greenbar.png"]];
image = [imgv image];
image.layer.anchorPoint = CGPointMake(0.5, 1.0);***-- Request for member 'layer' in something not a structure or union.***
imgv.image.layer.anchorPoint = CGPointMake(0.5, 1.0); ***-- Request for member 'layer' in something not a structure or union.***
imgv.layer.anchorPoint = CGPointMake(0.5, 1.0); ***-- Accessing unknown 'anchorPoint' component of a property.***
This is driving me crazy, so please help! :)
Thank you!
:bp:
layer is imageView property so the following line should be correct:
imgv.layer.anchorPoint = CGPointMake(0.5, 1.0);
The reason you get this error may be that you need to import quartzcore header:
#import <QuartzCore/QuartzCore.h>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With