I have 5 round buttons in a row, each one, 40×40 pixels. Between each one, I have 20 pixels.
40×40 pixels is too small to touch, but as I have 20 pixels of space between each button I can extend the button touch area to 60×60 pixels, making it easy to touch. I could simply using the dirty solution of creating a square 60×60 pixels transparent image, put this over the button and make this touchable, but I know it is possible to extend a button touch area by creating a custom class and changing a parameter.
I know this is possible because I saw this done before (but I cannot find the URL). I know it is something related to hitTest.
How can this be done?
Thanks.
Eiko is absolutely right. Here’s some simple code you can use that is independent of the button’s location that somebody gave me for expanding the Info button frame.
You might want to watch out if you’re using a background image as opposed to an image (
button setBackgroundImage:vsbutton setImage: forState:) because a background image will stretch with the frame while a normal image will not.