开发者

how to show image on right hand side of table view for iphone

开发者 https://www.devze.com 2023-01-09 09:45 出处:网络
i can show image on left hand side of table view but why my right hand side is not working CGRect frame;

i can show image on left hand side of table view but why my right hand side is not working

CGRect frame;

    frame= CGRectMake(310 ,10, 50, 50);
UIImageView *   myIm开发者_运维知识库ageView = [[UIImageView alloc]init];
    cell.myImageView.image = [UIImage imageNamed:@"bowl.png"];


    myImageView.frame = frame;
    [myImageView release];


Try this, it works for me:

UIImageView *image = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"yellow_dot.png"]];
cell.accessoryView = image;


Do this code in willDisplayCell and it should work. Also remember the default cell already has an imageview, you can just move its frame.

0

精彩评论

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