is it possible to increase tapable area of UIButton without changing size of Button’s background Image
I tried:
[shareButton setContentEdgeInsets:UIEdgeInsetsMake(top, left, bottom, right)];
&
[shareButton setImageEdgeInsets:UIEdgeInsetsMake(top, left, bottom, right)];
but none of these worked.
Any Suggestion please?
Make the UIButton of type
buttonWithType:UIButtonTypeCustomand assign to it an image of a smaller size.Do not set the image as the background image or it’ll grow with the button. Set it as the main image instead.
For example if you want to set the tappable area to a 64×64 size and you want to show an image sized 32×32: the button size should be be 64×64 and the image size should be 32×32.
Programmatically:
Interface Builder: