2012-03-18 1 views
4

버튼 배경으로 사용하기 위해 간단한 반지 드로잉을 정의했습니다. 다음은 내가 그 일을하고있다 방법은 다음과 같습니다 round_button 내가 반지를 정의 내 XML 파일입니다낮은 API 수준의 Android 드로어 블 모양 반지

 <RelativeLayout 
xmlns:android="http://schemas.android.com/apk/res/android" 
android:layout_height="fill_parent" 
android:layout_width="fill_parent" 
android:padding="30dip" 
android:orientation="vertical"> 

<TextView 
    android:text="@string/start_game" 
    android:layout_height="wrap_content" 
    android:layout_width="wrap_content" 
    /> 

<Button android:id="@+id/start" 
android:layout_height="wrap_content" 
android:layout_width="wrap_content" 
android:background="@layout/round_button" 
    android:layout_alignParentBottom="true" 
    /> 

</RelativeLayout> 

: 나는대로, 상대 레이아웃을 사용하고

<shape xmlns:android="http://schemas.android.com/apk/res/android" 
     android:shape="ring" 
    android:innerRadius="20dp" 
    android:thickness="1dp" 
    android:useLevel ="false" 
    > 
    <solid 
    android:color="@color/lines" /> 
    /> 

</shape> 

. 최소 sdk 레벨을 11 이상으로 설정하면 완벽한 결과를 얻을 수 있습니다. 하지만 문제는 내가 API 레벨을 낮추기 위해 그것을 변경하려 할 때, 3이라고 말하면, 링은 나타나지 않습니다! 여기에 무엇이 누락되어 있습니까?

답변

0

비슷한 문제가 발생했습니다. shape와 같이 useLevel 속성을 false로 설정하여이 문제를 해결했습니다.

<shape android:shape="ring" 
     android:thickness="@dimen/indicatorcircle_thickness" 
     android:useLevel="false"> 
     <size android:width="@dimen/indicatorcircle_size" android:height="@dimen/indicatorcircle_size"/> 
     <solid android:color="@color/white"/> 
</shape>