"setAffineTransform:" behaves differently around "setLayer:"
"setAffineTransform:" behaves differently around "setLayer:"
- Subject: "setAffineTransform:" behaves differently around "setLayer:"
- From: rajesh <email@hidden>
- Date: Tue, 3 Mar 2009 10:43:39 +0100
Hi All,
I am stuck again at seemingly obvious point, but I can't figure out
where
In MyView Class , below lines work fine for flipping the layer (but
whenever I try to resize or add a subLayer to it, view flashes for the
reason I don't know)
-(void)awakeFromNib{
drawLayer = [CALayer layer];
drawLayer.backgroundColor = CGColorCreateGenericRGB(1.0f,1.0f,1.0f,
1.0f);
CGAffineTransform transform = CGAffineTransformIdentity;
/* CGAffineTransform transform = CGAffineTransformMake (1.0f,0.0f,
0.0f,-1.0f,0.0f,0.0f); */
transform.d = -1.0f;
drawLayer.affineTransform = transform;
[self setLayer:drawLayer];
[self setWantsLayer:YES];
}
but when I try to check the flag uses CoreAnimation layer in interface
builder for MyView and use below lines
-(void)awakeFromNib
{
drawLayer = [self layer];
drawLayer.backgroundColor = CGColorCreateGenericRGB(1.0f,1.0f,1.0f,
1.0f);
CGAffineTransform transform = CGAffineTransformIdentity;
transform.d = -1.0f;
drawLayer.affineTransform = transform;
}
now I don't see any layer added , if I omit the affineTransform part ,
then view behaves perfectly with no flashes whatsoever but layer isn't
flipped.
Thanks in advance for any help.
~Rajesh
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden