UITableViewCell右边的图像? [英] UITableViewCell with image on the right?

查看:182
本文介绍了UITableViewCell右边的图像?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有没有办法将UITableViewCell.image设置为显示在单元格的右侧而不是左侧?或者我需要在单元格布局的右侧添加单独的UIImageView吗?

Is there a way to set the UITableViewCell.image to display on the right hand side of the cell instead of the left? Or will I need to add a separate UIImageView on the right side of the cell layout?

推荐答案

否。但是您可以轻松地将图像视图作为附件视图添加到表格单元格中以获得相同的效果。

No. But you can easily add an image view as the accessory view to a table cell for the same effect.

UIImageView *imageView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"foo.png"]];
cell.accessoryView = imageView;
[imageView release];

这篇关于UITableViewCell右边的图像?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆