开发者

Touch event problem of UIPopoverController and DetailViewController in iOS

开发者 https://www.devze.com 2023-03-06 09:06 出处:网络
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.

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;
0

精彩评论

暂无评论...
验证码 换一张
取 消