Touch area changing on custom UIButton with image and title on landscape mode

Posted by gkedmi on Stack Overflow See other posts from Stack Overflow or by gkedmi
Published on 2010-03-23T19:01:25Z Indexed on 2010/03/23 19:03 UTC
Read the original article Hit count: 444

Filed under:
|
|

hello all I'm trying to build a button that looks like the icons on the iphone , with an image and a title bellow.I'm working in landscape mode. I have a custom button on the IB with image and title and inside the code I use the methods :


[aButton setTitleEdgeInsets:UIEdgeInsetsMake(60.0, -50.0, 0.0, 0.0)];
[aButton setImageEdgeInsets:UIEdgeInsetsMake(-10.0, 29.0, 0.0, 0.0)];
my problem is that the area that react to the touch events is very small and is on the top left of the button , another problem is that if I change my button size I have to calculate again manually the values for these 2 functions. Is there any easy way to do it?and if not how can I fix the touch area? thanks Gilad

© Stack Overflow or respective owner

Related posts about uibutton

Related posts about landscape