iphone: customise cell.accessoryType
hi am doing an iphone twitter app with json and i am wondering if it is possible to set the cell.accessoryType to a image in UITableView? or possible move the image to the right hand side...any cl开发者_C百科ues?
Sure. Just use the accessoryView
property of UITableViewCell and assign a UIImageView
:
UIImage *image = [UIImage imageNamed:@"fileNameOfYourImage.jpg"]; //or wherever you take your image from
UIImageView *imageView = [[UIImageView alloc] initWithImage:image];
cell.accessoryView = imageView;
[imageView release];
No need to use imageview, just provide this for simple arrow.
cell.accessoryType=UITableViewCellAccessoryDisclosureIndicator;
精彩评论