views:

144

answers:

1

I'm testing a new iPhone app with my end-users and found that a lot of times they misses the clickable area of a UITableCell and perform the wrong action. (Some users never before use any kind of computer!).

Then I try myself and found that still I can fail sometimes. So I wonder how increase the tappable area of the cell with accessoryType = UITableViewCellAccessoryDetailDisclosureButton

I try reducing the width of the contenview but still fail. I think is necesary hit exactly thw blue arrow to hit it.

I want something like the last 1/4 of the cell be the hit area.

A: 

This thread has a pretty good block of code showing how to do it. Read down to the comments; the code in the blog post itself is not correct.

The key is to overload -hitTest:withEvent: for the UITableViewCell. You will be passed a point, and you can then return any view you want as the view that is being touched.

For fun, you might try changing the frame of the accessory view and seeing what happens. I doubt this will work as well as the -hitTest:withEvent: overload, but it's so easy that it's worth trying.

Rob Napier