2010-03-13 4 views
1

비뚤어진 모양 버튼을 만들 수 있습니까?
(즉, 화면의 왼쪽 하단에서부터 정사각형 또는 직사각형 모양의 단추 대신 화면의 오른쪽 상단까지 줄무늬 모양과 유사)? 이 이미지 같은Android - 비뚤어진 버튼

뭔가 http://www.codeproject.com/KB/silverlight/SilverLightFAQPart2/9.JPG
는 그리고 나는 확실히 클릭 할 수있는 영역도 단지 색깔의 하나입니다 확인해야합니다.

감사합니다,

티 당신은 그것을 위해 자신의 클래스를 작성해야 할 것

답변

0

. View 하위 클래스에서 onClick 이벤트를 수신하고 수신 대기합니다.

0

선택기를 배경으로 사용해보십시오.

<Button 
     android:layout_width="fill_parent" 
     android:layout_height="wrap_content" 
     android:text="@string/hello" 
     android:background="@drawable/my_button" 
    /> 

그리고 당신의 당김 폴더에 my_button.xml을합니다.

<?xml version="1.0" encoding="utf-8"?> 
<selector xmlns:android="http://schemas.android.com/apk/res/android"> 
    <item android:state_focused="true" android:state_pressed="false" android:drawable="@drawable/focused" /> 
    <item android:state_focused="true" android:state_pressed="true" android:drawable="@drawable/focusedpressed" /> 
    <item android:state_focused="false" android:state_pressed="true" android:drawable="@drawable/pressed" /> 
    <item android:drawable="@drawable/defaultbutton" /> 
</selector> 

출처 : http://www.anddev.org/tinytutcustom_button_backgrounds-better_imagebutton-t4298.html