I've implemented a custom view for my UITableView section headers (via viewForHeaderInSection). When in plain view mode, the default behavior seems to be that the cells float underneath the section headers and touch events fall through to the cells underneath.
How can I have the custom section header view respond first to any touch events inside its bounds and take some action, rather than passing the event to the cell underneath the section header view?
Use an UIControl instead of an UIView with
[aControl addTarget:<target> action: @selector(<desiredSelector:>) forControlEvents:UIControlEventTouchUpInside];
See http://developer.apple.com/library/ios/#samplecode/TableViewUpdates/Introduction/Intro.html It catch the tap events and perform action method. It may help you.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With