2017-04-11 2 views

답변

1

이 같은 당김을 추가하고 배경을 사용할 수 있습니다

<?xml version="1.0" encoding="utf-8"?> 
<selector 
    xmlns:android="http://schemas.android.com/apk/res/android"> 
    <item> 
     <shape> 
      <stroke android:width="2px" android:color="#000000"/> 
      <corners android:radius="10.0dip" /> 
     </shape> 
    </item> 
</selector> 

당신은 당김 모양 here에 대한 자세한 예제와 설명을 찾을 수 있습니다.

1
당신은 버튼의 이런 종류의 당김을 만들 수 있습니다

,

<?xml version="1.0" encoding="utf-8"?> 
<shape xmlns:android="http://schemas.android.com/apk/res/android" 
    android:shape="rectangle" > 

    <stroke android:width="1dp" 
     android:color="@color/grey_text"/> 

    <gradient android:startColor="@android:color/transparent" 
     android:endColor="@android:color/transparent" 
     android:angle="90"/> 
</shape> 
1

사용이 개 Button의 모두에 대해 서로 다른 배경 드로어 블을 만듭니다.

왼쪽 버튼 배경 :

<?xml version="1.0" encoding="utf-8"?> 
    <shape xmlns:android="http://schemas.android.com/apk/res/android"> 
     <stroke 
      android:width="1dp" 
      android:color="#ffffff" /> 
     <corners 
      android:bottomLeftRadius="4dp" 
      android:topLeftRadius="4dp" /> 
    </shape> 

마우스 오른쪽 버튼 배경 :

<?xml version="1.0" encoding="utf-8"?> 
<shape xmlns:android="http://schemas.android.com/apk/res/android"> 
    <stroke 
     android:width="1dp" 
     android:color="#ffffff" /> 
    <corners 
     android:bottomRightRadius="4dp" 
     android:topRightRadius="4dp" /> 
</shape> 
관련 문제