Re: Can an image be "rejected" by CALayer?
Re: Can an image be "rejected" by CALayer?
- Subject: Re: Can an image be "rejected" by CALayer?
- From: Matt Neuburg <email@hidden>
- Date: Fri, 08 Apr 2011 05:17:29 -0700
On Wed, 06 Apr 2011 18:44:04 +0800, Gabriel Zachmann <email@hidden> said:
>I am creating CA layers like so:
>
> CALayer * imgLayer = [CALayer layer];
> imgLayer.contents = (id) image;
> imgLayer.contentsGravity = kCAGravityResizeAspect;
> imgLayer.delegate = nil;
> imgLayer.opacity = 1.0;
> imgLayer.position = CGPointMake( drawRect_.size.width/2.0, drawRect_.size.height/2.0 );
> imgLayer.anchorPoint = CGPointMake( 0.5, 0.5 );
> imgLayer.zPosition = -1.0;
>
>Now, sometimes, the image does not get displayed (most images do get displayed).=
What is "image"? If it is not a CGImageRef, setting the layer's contents will fail *silently*. I wish I had a nickel for every time I assigned a UIImage to a layer's contents and then wasted a day trying to figure out why I couldn't see the layer in the interface.... m.
--
matt neuburg, phd = email@hidden, <http://www.apeth.net/matt/>
A fool + a tool + an autorelease pool = cool!
Programming iOS 4!
http://www.apeth.net/matt/default.html#iosbook_______________________________________________
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