the UIImageView is not visible in the UITableViewCell

18 views
Skip to first unread message

hu haibara

unread,
Jun 2, 2012, 12:04:19 AM6/2/12
to iphonesdkd...@googlegroups.com
I add a UIImageView In the UITableView Cell,but it is not visible. But when you selected the row, the image is visible, it is so puzzled. can you help me ?
- (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString  *)
 reuseIdentifier    
{  
self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
if (self) {
       cellImage
= [[UIImageView alloc] initWithImage:[UIImage
imageNamed
:@"one.png"]];      
        cellImage
.frame = CGRectMake(240, 0, 20, 20);
       
[self.contentView addSubview:cellImage];
       
self.textLabel.text = @"parent";
}
 
return self;
}

Y%G(IH0EAIE5}[BU}0S2I0E.jpg

Prasanna D

unread,
Jun 2, 2012, 12:29:13 AM6/2/12
to iphonesdkd...@googlegroups.com
hai, either use contentview or accessoryview, dont use both and u adding the view as a subview for cell but is not the proper way in tableview

--
You received this message because you are subscribed to the Google Groups "iPhone SDK Development" group.
To post to this group, send email to iphonesdkd...@googlegroups.com.
To unsubscribe from this group, send email to iphonesdkdevelop...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/iphonesdkdevelopment?hl=en.



--
With Warm Regards
D.Prasanna.



hu haibara

unread,
Jun 2, 2012, 12:38:27 AM6/2/12
to iphonesdkd...@googlegroups.com
en,thank you,I set the accessoryView and it works.

2012/6/2 Prasanna D <prasa...@greatinnovus.com>
Reply all
Reply to author
Forward
0 new messages