one method to resolve table cell can not be selected

来源:互联网 发布:linux test -e 编辑:程序博客网 时间:2024/05/22 11:49

Swift:

func tableView(tableView: UITableView, heightForRowAtIndexPath indexPath: NSIndexPath) -> CGFloat {
return (CGFloat(106)) // MUST Return CGFloat type value
//return tableView.estimatedRowHeight default is 0, will
//Xcode 8 even not giving an error if you return other type,
//other type will cause table cell can not be selected

}

using tableView.userInteractionEnabled = true can not solve the problem.

Objectiv-C:
- (CGFloat)tableView:(UITableView )tableView heightForRowAtIndexPath:(NSIndexPath )indexPath{
return 44;
}

0 0
原创粉丝点击