开发者

iphone: customise cell.accessoryType

开发者 https://www.devze.com 2023-02-13 00:04 出处:网络
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开发

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;

0

精彩评论

暂无评论...
验证码 换一张
取 消