Touch event problem of UIPopoverController and DetailViewController in iOS
My iPad project used the default split view template, and now me explain the layouts.
In portrait mode, the UIPopoverController contains a UINavigationController which has a UITableView.
For the DetailViewController, it contains a UIImageView which detects touch events.
I implemented the swipe-to-delete method in the UITableView in the UIPopoverController.
However, when I swipe to delete an item in the UI开发者_Go百科TableView, the underlying UIImageView also receives the swipe touch event.
How to block the underlying UIImageView to receive the touch event when UIPopoverController is visible (active) ?
Thanks.
you could disable the by setting the property userInteractionEnabled
with NO for your UIImageView
. therefore your UIImageView
will be ignored and removed from the event queue
@property(nonatomic, getter=isUserInteractionEnabled) BOOL userInteractionEnabled
So use as below
myImageView.userInteractionEnabled = NO;
精彩评论