将图像添加到uitableview单元格 [英] add image to uitableview cell

查看:111
本文介绍了将图像添加到uitableview单元格的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有 tableview ,如何将图片添加到此单元格的左侧?

I have a tableview, how can I add image to the left of this cells?

推荐答案

cell.imageView.image = [UIImage imageNamed:@"image.png"];

更新:
像Steven Fisher说的那样,这应该适用于UITableViewCellStyleDefault样式的单元格是默认样式。对于其他样式,您需要将UIImageView添加到单元格的contentView。

UPDATE: Like Steven Fisher said, this should only work for cells with style UITableViewCellStyleDefault which is the default style. For other styles, you'd need to add a UIImageView to the cell's contentView.

这篇关于将图像添加到uitableview单元格的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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