[英]how to show image on right hand side of table view for iphone
我可以在表格视图的左侧显示图像,但是为什么我的右侧不起作用
CGRect frame;
frame= CGRectMake(310 ,10, 50, 50);
UIImageView * myImageView = [[UIImageView alloc]init];
cell.myImageView.image = [UIImage imageNamed:@"bowl.png"];
myImageView.frame = frame;
[myImageView release];
试试这个,对我有用:
UIImageView *image = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"yellow_dot.png"]];
cell.accessoryView = image;
在willDisplayCell
执行此代码,它应该可以工作。 还请记住,默认单元格已经具有图像视图,您只需移动其框架即可。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.