Re: "setAffineTransform:" behaves differently around "setLayer:"
Re: "setAffineTransform:" behaves differently around "setLayer:"
- Subject: Re: "setAffineTransform:" behaves differently around "setLayer:"
- From: rajesh <email@hidden>
- Date: Wed, 4 Mar 2009 11:06:07 +0100
I tried changing some lines
[self setWantsLayer:YES];
pages = [[NSMutableArray alloc] init];
drawLayer = self.layer;
drawLayer.backgroundColor = CGColorCreateGenericRGB(1.0f,1.0f,1.0f,
1.0f);
CGAffineTransform trans =
CGAffineTransformMake(1.0,0.0,0.0,-1.0,0.0,0.0);
self.layer.affineTransform = trans;
but the layers appear only after resizing the view and not to mention
scrolling totally messes with the sublayer and they just disappear, i
need to resize the view to make the sublayers appear again.
Any help is appreciated.
Thanks
Rajesh
On Mar 3, 2009, at 10:43 AM, rajesh wrote:
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
_______________________________________________
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