更改iPhone UITableView单元格中的边框颜色(未分组) [英] Changing border color in iPhone UITableView cells (non-grouped)

查看:135
本文介绍了更改iPhone UITableView单元格中的边框颜色(未分组)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已阅读(并使用过)代码 here ,说明如何在iPhone上以分组模式更改UITableViewCell的背景颜色和边框颜色。我正在编写一个应用程序,它有一个非分组的UITableView,我需要更改单元格的边框颜色。我知道我可以修改代码并创建一个新的背景视图并应用它,但是有必要吗?

I've read (and used) the code here which illustrates how to change the background color and border color of a UITableViewCell in grouped mode on the iPhone. I'm writing an app now which has a non-grouped UITableView and I need to change the border color of the cells. I know that I can modify the code and create a new background view and apply it, but is it necessary?

如果UITableViewCell是非分组样式,是否可以轻松指定边框颜色?

Is there an easy way to specify the border color of a UITableViewCell if it is a non-grouped style?

推荐答案

如果通过普通表格视图中的边框颜色表示单元格之间的分隔线(默认颜色为灰色),则可以通过以下方式为整个表格视图自定义此颜色: / p>

If by "border color" in a plain table view you mean the separator lines between the cells (default color gray), you can customize this color for the whole table view via:

tableView.separatorColor = [UIColor blueColor];

参见 UITableView参考

这篇关于更改iPhone UITableView单元格中的边框颜色(未分组)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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