ios - 显示 UItableViewcell 选择

标签 ios xcode uitableview swift

我想在不选择 cell 的情况下显示 UITableViewCell 选择样式“灰色”。我怎样才能做到这一点?但我只想在 UITableView 的第一行显示它。有什么建议吗?

最佳答案

if (indexPath.row == 0)    
     cell.backgroundColor = [UIColor greyColor];

放入:

-(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {

}

关于ios - 显示 UItableViewcell 选择,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27292721/

相关文章:

ios - UITableView didSelectRowAtIndexPath 从未调用过

ios - 重新编译现有的 objective c 库以支持 arm8

ios - TableView不符合协议(protocol)

ios - 立即停止方法/对象?

ios - SwiftUI:创建自定义警报

ios - 在 UITableViewCell 中使用高分辨率图像进行自定义滑动机制

ios - UITableViewCell 不显示 UILabel

ios - 在 iOS 中以编程方式清空缓存

ios - 通过单击另一个按钮更改按钮文本垂直对齐方式

ios - Mjpeg 在最近的 Mobile Safari 上损坏了?