4
我已经定义了一个简单的可绘制环形来将其用作按钮背景。 这里就是我如何做它:更低API级别的Android可绘制形状环
<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>
我在一个相对布局使用它,因为:
<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>
哪里round_button是我所定义的环我的XML文件。 当我已经设定了最低sdk等级11或更高时,它给了我完美的结果。但问题是,当我试图改变它降低API水平,说3,环没有出现! 我在这里失踪了什么?