触摸时不突出显示表视图行

发布于 2024-11-02 16:25:16 字数 49 浏览 6 评论 0原文

当我选择表视图的一行时,它会变成蓝色。我希望当我触摸该行时不会改变颜色。我该怎么做?

When I select a row of a table view, it becomes blue. I want the row to not change color when I touch it. How can I do this?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

朱染 2024-11-09 16:25:16

每个单元格都需要其中之一:

cell.selectionStyle = UITableViewCellSelectionStyleNone;

each cell will need one of these:

cell.selectionStyle = UITableViewCellSelectionStyleNone;
软糯酥胸 2024-11-09 16:25:16

如果您想禁止选择表中的所有行,则在表视图控制器的设置中(例如在viewDidLoad中),设置

self.tableView.allowsSelection = NO;

参考:http://developer.apple.com/library/ios/#documentation/UIKit/Reference/UITableView_Class/Reference/Reference.html

If you want to disallow selection of all rows in your table, then in the setup of your table's view controller (such as in viewDidLoad), set

self.tableView.allowsSelection = NO;

Reference: http://developer.apple.com/library/ios/#documentation/UIKit/Reference/UITableView_Class/Reference/Reference.html

愚人国度 2024-11-09 16:25:16

在 cellforrowatindexpath 下,将变量分配给“cell”对象

cell.selectionStyle = UITableViewCellSelectionStyleNone;

Under the cellforrowatindexpath, assign a variable to the 'cell' object

cell.selectionStyle = UITableViewCellSelectionStyleNone;
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文