UIImage, UIColor colorWithPatternImage:, and PNG transparency
UIImage, UIColor colorWithPatternImage:, and PNG transparency
- Subject: UIImage, UIColor colorWithPatternImage:, and PNG transparency
- From: Matt James <email@hidden>
- Date: Fri, 7 May 2010 22:15:25 -0400
Hey everyone,
I'm having trouble getting a png with transparency to show up properly as a
background image. Right now it *looks* like the transparent area is coming
over as black. Here's the relevant code:
self.selectedBackground = [UIImage imageNamed:@"selected-group.png"];
self.backgroundColor = [UIColor
colorWithPatternImage:self.selectedBackground];
Nothing in the docs seems to indicate that I should be doing anything
differently to force support for transparent PNGs, but I also noticed that
whenever I add a UIImageView in IB, it defaults to "Opaque" as checked which
I have to un-check to support the transparency in my PNG files. Is there a
programatic equivalent to unchecking that box on a UIImage or UIColor?
Also it might be worth noting that the UIView this code is being applied to
has "Opaque" unchecked in IB, in case that makes any difference.
Thanks for any help!
-
Matt James
http://www.macyenta.com
_______________________________________________
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