禁用单个UITableViewCell的选择 [英] Disable selection of a single UITableViewCell

查看:70
本文介绍了禁用单个UITableViewCell的选择的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何禁用在UITableView中只选择单个单元格?我有几个,我只想要最后一个被禁用。

How do you disable selecting only a single cell in a UITableView? I have several, and I only want the last to be disabled.

推荐答案

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

    cell.selectionStyle = UITableViewCellSelectionStyleNone;

}

这篇关于禁用单个UITableViewCell的选择的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆