【发布时间】:2016-11-04 13:29:34
【问题描述】:
我在 UIViewController 的底层有一个 UIButton。 我在 UIButton 顶部有一个 UITableView(全屏尺寸),UITableView 有一个标题(UIView),它有一个透明背景,可以看穿并显示 UIButton。
即使按钮出现在 tableview 标题后面,UIButton 也是不可点击的。
我的tableView的单元格和tableView的表头有按钮,所以无法设置headerView.userInteraction = true或tableView.userInteraction = true
我尝试使用pointInside:withEvent:和hitTest:withEvent:,UIButton在这两种情况下仍然无法点击。
有什么建议吗?谢谢
【问题讨论】:
-
为什么不在标题中的uiview中添加按钮?
-
有什么原因不能只将按钮添加到 tableview 的标题中?
-
我在 tableView 后面有一个背景图像,当 tableView 滚动时它不会滚动。该按钮将与该背景保持一致。这就是为什么我将按钮放在 tableView 后面而不是放在标题中的原因。
标签: ios uitableview uibutton clickable