2014-03-04 1 views
3

나는어떻게 이런 유형의 드로잉 가능한 모양, 안드로이드를 만들 수 있습니까?

enter image description here

모양은 그대로 바닥 모서리를 떠나 왼쪽 상단과 오른쪽 상단에 둥근 모서리 사각형 모양에 있어야 형태의 XML을 사용하여 안드로이드에이 모양을 확인해야합니다.

나는 다음하지만

<?xml version="1.0" encoding="utf-8"?> 
    <shape xmlns:android="http://schemas.android.com/apk/res/android" 
    android:shape="rectangle" > 
    <corners 
    android:topLeftRadius="10dp" 
    android:topRightRadius="10dp" 
     /> 
    <gradient 
    android:angle="270" 
    android:endColor="@color/Red" 
    android:startColor="@color/Red" 
    android:type="linear" /> 
    </shape> 

답변

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

    <solid android:color="#ff0000" /> 

    <corners 
     android:topLeftRadius="4dp" 
     android:topRightRadius="4dp" /> 

    <padding 
     android:bottom="5dip" 
     android:left="10dip" 
     android:right="10dip" 
     android:top="5dip" /> 

</shape> 
같은 <corners>를 설정 작동하지 않는 시도
1

가에서 XML

<corners 
    android:radius="1dp" 
    android:topLeftRadius="10dp" 
    android:topRightRadius="10dp" 
    android:bottomLeftRadius="0dp"  
    android:bottomRightRadius="0dp"/>