So I have a UITableView nested inside a UITableViewCell, like:
UITableView baseTable
UITableViewCell baseTableCell0
UITableViewCell baseTableCell1
subView has a UITapGestureRecognizer connected, acts like a button subTableView and subCollectionView should receives touch events and perform didSelectRowAtIndexPath
On iOS 8 this works fine, but when i'm testing on ios 7 the cells in subTableView and subCollectionView does not receives touch event anymore, the touch event is sent to [baseTableView tableview... didSelectRowAtIndexPath]. However the UITapGestureRecognizer on subView can still receive touch event.
在标签手势对象上使用此代码
tap.cancelsTouchesInView = NO;
Try changing the background color of your UITableView, UITableViewCell and UIView, this way you can see if your child view is not exceeding your parent view, if it is the case your child view is not going to receive touch events. Then either adjust Parent to show child fully or adjust child to remain in the parent boundary.
Hope it helps!
EDIT:
May be passing touch events to subviews can help.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.