开发者

UITableView allowsSelection property for specific section

is there a way to set the allowsSelection property of UITableView for each table section separately, and not for the whole tabl开发者_如何学运维e ?


Doesn't look like it. Here's what you do: use the indexPath.section value to set the cell's .selectionStyle to UITableViewCellSelectionStyleNone and to return early from -didSelectRowAtIndexPath.

In other words, you'll configure cells in certain sectinos to not flash blue when selected, and when it IS selected, not to do anything. It'll be just as if that section had its allowsSelection property set to NO.


Try using the willSelectRowAtIndexPath method and return nil for the section you don't want to allow selection on.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜