当我选择表视图的一行时,它会变成蓝色。我希望当我触摸该行时不会改变颜色。我该怎么做?
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?
每个单元格都需要其中之一:
cell.selectionStyle = UITableViewCellSelectionStyleNone;
each cell will need one of these:
如果您想禁止选择表中的所有行,则在表视图控制器的设置中(例如在viewDidLoad中),设置
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
Reference: http://developer.apple.com/library/ios/#documentation/UIKit/Reference/UITableView_Class/Reference/Reference.html
在 cellforrowatindexpath 下,将变量分配给“cell”对象
Under the cellforrowatindexpath, assign a variable to the 'cell' object
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
暂无简介
文章 0 评论 0
接受
发布评论
评论(3)
每个单元格都需要其中之一:
each cell will need one of these:
如果您想禁止选择表中的所有行,则在表视图控制器的设置中(例如在
viewDidLoad
中),设置参考: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
), setReference: http://developer.apple.com/library/ios/#documentation/UIKit/Reference/UITableView_Class/Reference/Reference.html
在 cellforrowatindexpath 下,将变量分配给“cell”对象
Under the cellforrowatindexpath, assign a variable to the 'cell' object