【发布时间】:2012-03-18 15:56:53
【问题描述】:
我定义了一个简单的环形可绘制对象,将其用作按钮背景。 这是我的做法:
<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,环没有出现! 我在这里错过了什么?
【问题讨论】: