Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

chinnybloke

macrumors newbie
Original poster
Sep 6, 2008
8
0
Hello,

I have a table view cell with 3 subviews added, 2 labels and an imageview. Under the emulator the image view correctly shows png transparency in the cell, but when I upload the app to my ipodtouch for testing, the png areas that should be transparent show as black. Is this a bug or something I am missing which is overriding this?

My code is:
Code:
- (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
	if (self = [super initWithStyle:style reuseIdentifier:reuseIdentifier])
	{
		// Layout cellstyle
		messageLabel = [[UILabel alloc] initWithFrame:CGRectMake(5, 10, 240, 50)];
		
		// Setup layout
		UIImage *messageImage = [UIImage imageNamed:@"unread.png"];
		statusImageView = [[UIImageView alloc] initWithImage:messageImage];
		statusImageView.frame = CGRectMake(250, 40, 35, 35); 
		messageLabel.font = [UIFont fontWithName:@"Helvetica" size:15];
		messageLabel.numberOfLines = 3;
		
		[self.contentView addSubview:titleLabel];
		[self.contentView addSubview:messageLabel];
		[self.contentView addSubview:statusImageView];
	}
	
	return self;
}

Thanks in advance
 

robbieduncan

Moderator emeritus
Jul 24, 2002
25,611
893
Harrogate
Try setting the background colour of statusImageView to be transparent. Most likely it's set to black and that's what you are seeing.
 

chinnybloke

macrumors newbie
Original poster
Sep 6, 2008
8
0
Try setting the background colour of statusImageView to be transparent. Most likely it's set to black and that's what you are seeing.

Still no joy. I've added
Code:
statusImageView.backgroundColor = [UIColor clearColor];
and only on the device does it still show black where the transparency should be. Emulator on iMac shows it working
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.