Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Making a button easier to click

I have a button that on certain phones is too hard to click because of its size.

But making it bigger breaks layout.

It is possible to explain to a view that it has a bigger "click box" than its visible area?

like image 419
speeder Avatar asked Aug 01 '11 12:08

speeder


2 Answers

Not sure if this can help:

If you use an ImageButton with no background and you set a Padding value, your button will have a larger clickable area.

<ImageButton android:layout_width="wrap_content" android:layout_height="wrap_content" 
    android:src="@drawable/img_close" android:id="@+id/btnClose" 
    android:padding="25dip" android:background="#0000"></ImageButton>
like image 182
Xavi Gil Avatar answered Sep 28 '22 07:09

Xavi Gil


Propably the best thing would be to create a layout for each density / screen size.

like image 41
keyboardsurfer Avatar answered Sep 28 '22 09:09

keyboardsurfer