2012-03-18 3 views
4

ボタンの背景として使用するための単純なリングドロウアブルを定義しました。 は、ここで私はそれをやっている方法は次のとおりです。round_buttonは、私はリングを定義している私のxmlファイルである下のAPIレベルのAndroid Drawable Shapeリング

 <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

私は似たようなことに遭遇しました。私は、このようにシェイプ上で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> 
関連する問題