Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我在我的应用程序中向 UITableView 添加了一个子视图,添加后,tableViewCell 仍然可以点击,如何防止这种情况?请帮助
如果我这次理解了你的问题,如果你可以让子视图变成屏幕的大小,那么你只需要在子视图上将 userInteractionEnabled 设置为 TRUE 即可。
用一个简单的 UITableView 和一个 UIImageView 对其进行了测试。如果我禁用 userInteractionEnabled 则调用 tableView 委托的 willSelectRowAtIndexPath ,如果我将其设置为 TRUE 则没有任何反应。