0

I read here and here about some methods to increase the button's click area. But my problem is the opposite. The button is 100x100 px, and when I click outside of it (on a RelativeLayout) the button gets clicked (changes to its pressed state).

I tried putting it inside a LinearLayout set to wrap_content (hoping to separate it from the background), but that didn't work.

I also tried to set its padding to 0. Didn't work.

android:duplicateParentState="false" didn't work as well.

Why is this happening?

Community
  • 1
  • 1
Alaa M.
  • 4,961
  • 10
  • 54
  • 95

1 Answers1

3

Use this. It worked for me.

android:minHeight="0dp"
android:minWidth="0dp"

There is a minimum touch area saved already, of approx 50dp. So that it is clickable. Use these lines, and then set the values you would like.

Samrat Dutta
  • 1,727
  • 1
  • 11
  • 23