开发者

How to programmatically choose a default thumbnail image?

I have a tableView based app and I made a custom TableViewCell that have a thumbnail in it. I wish to programmatically choose a default thumbnail image for my custom TableViewCell. any ideas on how to do tha开发者_JS百科t?

Thanks.


Set tag for your UIImageView in your custom UITableViewCell, for example, let it be 10.

When you want to show image in that view for some UITableViewCell *cell; do next:

UIImageView *imageView = (UIImageView *)[cell viewForTag:10];
imageView.image = [UIImage ....];


    - (void)setCellIconImage:(UIImage*)iconImage
    {
        self.imgView.image = iconImage;
    }
0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜