美文网首页
iOS tableView点击cell弹出Controller有

iOS tableView点击cell弹出Controller有

作者: Accepted_ | 来源:发表于2017-04-17 13:39 被阅读0次

    点击tableView某一个cell会有延迟,有时延时4、5秒有时会延时8、9秒。如果点击第二下,就会立刻弹出。

    百度查找解决办法,总结了两个方法

    一:把cell的selectionStyle设为YES,或者设为1、2、3

    cell.selectionStyle = YES;

    cell.selectionStyle = UITableViewCellSelectionStyleBlue; // 1

    cell.selectionStyle = UITableViewCellSelectionStyleGray;  //2

    cell.selectionStyle = UITableViewCellSelectionStyleDefault;  //3

    反正不要设置为None。即

    cell.selectionStyle = UITableViewCellSelectionStyleNone; //错误

    二:如果上面的方法还不行,那就在

    - (void)tableView:(UITableView*)tableView didSelectRowAtIndexPath:(NSIndexPath*)indexPath

    方法中加一句

    [tableView deselectRowAtIndexPath:indexPath animated:YES];

    就解决了。

    相关文章

      网友评论

          本文标题:iOS tableView点击cell弹出Controller有

          本文链接:https://www.haomeiwen.com/subject/badtzttx.html