目前遇到这种情况是在 cell 的选择状态 selectionStyle 设为 UITableViewCellSelectionStyleNone 时出现,而用 UIAlertView 是不会有这样的 bug 的(这应该是 UIAlertController 的一个 bug)。但 UIAlertView 在 9.0 之后就被废弃了,不推荐再用。所以今天我就记录一下 UIAlertController 如何处理卡顿问题。
方法一:
cell 的选中样式 selectionStyle 不要设为 UITableViewCellSelectionStyleNone。
方法二:
如果界面的确不需要选中样式,那么可以采取如下处理方式
cell.selectionStyle = UITableViewCellSelectionStyleNone;
然后在 didSelectRowAtIndexPath 方法中取消选中状态
-(void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath{
[tableView deselectRowAtIndexPath:indexPath animated:NO];
// 处理点击 cell 的后续逻辑
}
网友评论