![](/img/trans.png)
[英]How to simulate allowsSelection on a UITableView before iPhone OS 3.0?
[英]UITableView allowsSelection property for specific section
有没有办法分别为每个表部分设置UITableView的allowsSelection属性,而不是整个表?
看起来不像。 这里是你做什么:使用indexPath.section值来设置单元格的.selectionStyle
到UITableViewCellSelectionStyleNone
并从提前返回-didSelectRowAtIndexPath
。
换句话说,您将在某些sectinos中配置单元格,以便在选中时不闪烁蓝色,并且在选择时,不执行任何操作。 就好像该部分的allowsSelection
属性设置为NO一样。
尝试使用willSelectRowAtIndexPath方法并为您不希望选择的部分返回nil。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.