简体   繁体   English

带有UITableView作为子视图的UIView

[英]UIView with UITableView as subview

I have a UIView with a UITableView as subview. 我有一个带有UITableView作为子视图的UIView。 When I add a gesture recogniser to the view, my "table did select row" is not triggered anymore, but the gesture recogniser is always triggered? 当我向视图添加手势识别器时,不再触发我的“表已选择行”,但始终会触发手势识别器? I have tried to remove the gesture recogniser from the tableview, but it has no effect. 我试图从表格视图中删除手势识别器,但是它没有任何效果。

let viewRecognizer = UITapGestureRecognizer(target: self, action: "handleTap")
viewRecognizer.delegate = self
self.view.addGestureRecognizer(viewRecognizer)
//This has no effect!
orderTableView.removeGestureRecognizer(viewRecognizer)

Have you set the cancelsTouchesInView to NO for the UIView ? 您是否cancelsTouchesInView UIViewcancelsTouchesInView设置为NO

See documentation 参阅文件

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 将UITableview添加为UIView的子视图时遇到问题 - Trouble in adding a UITableview as subview of UIView 如何将静态UITableView设置为UIView的子视图? - How to setup a static UITableView as a subview of UIView? UIView高度未调整为UITableView标头中的子视图高度 - UIView height not adjusting to subview heights in UITableView header 如何将UITableView添加到已经是子视图的UIView中? - How to add UITableView to UIView which is already a subview? 如何将UITableView作为子视图添加到UIView? - How can I add a UITableView as a subview to a UIView? 当UITableview是Custom UIView的子视图时,处理UITableView委托 - Handling UITableView delegates when the UITableview is a subview of a Custom UIView 未调用cellForRowAtIndexPath,但为UITableView调用的numberofRowsInSection已添加为UIView的子视图 - cellForRowAtIndexPath not called but numberofRowsInSection called for UITableView added as subview to UIView 当UITableView是UIView的子视图时(数据最初加载),未调用NSFetchedResultsControllerDelegate方法 - NSFetchedResultsControllerDelegate methods not called when UITableView is a subview of UIView (data initially loads) 如何使UITableView追溯成为UIView的子视图? - How can you make UITableView a subview of UIView retrospectively? 从iOS中的UIView子视图重新加载时,UITableView无法重新加载 - UITableView not reloading while reload from UIView subview in iOS
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM