UITableView 点击事件创建UIAlertControl

2017-02-21  本文已影响0人  闻醉山清风

UITableViewCell 中 - (void)tableView:(UITableView*)tableView didSelectRowAtIndexPath:(NSIndexPath*)indexPath方法中点击弹出UIAlertController会出现延迟,有时需要点击两次才会出现。

解决方法:

//设置cell的选中状态为默认状态

1,cell.selectionStyle=UITableViewCellSelectionStyleDefault;

//点击方法中设置反选

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

{

[tableViewdeselectRowAtIndexPath:indexPathanimated:NO];

}

上一篇 下一篇

猜你喜欢

热点阅读