点击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];
就解决了。
网友评论