안드로이드 버튼 클릭 영역 확보하기

Android 2015. 2. 27. 10:35

<FrameLayout 

android:id="@+id/n_prev"

android:layout_width="150px"

android:layout_height="80px"

android:layout_marginLeft="430px"

android:layout_marginTop="35px" >

<ImageButton 

android:layout_gravity="center"

android:layout_width="29px"

android:layout_height="51px"

android:background="@drawable/nuri_arrow0"

android:clickable="false" />

</FrameLayout>


Button 사이즈보다 확장된 크기의 FrameLayout 안에 Button을 배치하고 FrameLayout에 리스너를 걸어주면 해결!


android:clickable="false"

Button의 이미지 영역만큼 클릭영역이 제외되는데 Button에 따로 클릭리스너를 걸어주기보다는 클릭되지 않도록 처리하는 것이 깔끔하다.


요기서 참고

http://devbible.tistory.com/27



: