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;
}
You should just add
cellImageas anaccessoryView.