如何自定义UITableViewCell的背景颜色? [英] How to customize the background color of a UITableViewCell?

查看:104
本文介绍了如何自定义UITableViewCell的背景颜色?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想自定义我的UITableView中的所有UITableViewCell的背景(也许是边框)。到目前为止,我还没有能够自定义这个东西,所以我有一堆白色背景单元格是默认的。

I would like to customize the background (and maybe the border too) of all of the UITableViewCells within my UITableView. So far I have not been able to customize this stuff, so I have a bunch of white background cells which is the default.

有一种方法来做到这一点iPhone SDK?

Is there a way to do this with the iPhone SDK?

推荐答案

您需要将单元格的contentView的backgroundColor设置为您的颜色。如果您使用配件(例如公开箭头等),它们会显示为白色,因此您可能需要滚动这些配件的自定义版本。

You need to set the backgroundColor of the cell's contentView to your color. If you use accessories (such as disclosure arrows, etc), they'll show up as white, so you may need to roll custom versions of those.

这篇关于如何自定义UITableViewCell的背景颜色?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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