我得到了一些問題,同時改變單選按鈕的背景屬性改變單選按鈕的背景覆蓋文字上的單選按鈕的Android
所有我想每個單選按鈕其中有三個在一個單選框組
這裏是下面創建行的第一個下面的代碼
<RadioGroup
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:divider="@android:color/black"
android:orientation="vertical" >
<RadioButton
android:id="@+id/radioBtnFirst"
android:layout_width="fill_parent"
android:layout_height="0dp"
android:layout_weight="1"
android:background="@drawable/custom_radiogroup_divider"
android:text="Answer 1"/>
<RadioButton
android:id="@+id/radioBtnTwo"
android:layout_width="fill_parent"
android:layout_height="0dp"
android:layout_weight="1"
android:background="@drawable/custom_radiogroup_divider"
android:text="Answer 2"/>
<RadioButton
android:id="@+id/radioBtnThree"
android:layout_width="fill_parent"
android:layout_height="0dp"
android:layout_weight="1"
android:background="@drawable/custom_radiogroup_divider"
android:text="Answer 3"/>
</RadioGroup>
現在,在抽拉夾custom_radiogroup_divider.xml是
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle" >
<solid android:color="@android:color/transparent" />
<stroke
android:width="0.3dp"
android:color="@android:color/black" />
</shape>
,但現在的問題是,當我使用的背景屬性
的單選按鈕,看起來像文字重疊單選按鈕
做按鈕將刪除左電臺圖標方:( – Raksha
@Raksha當你設置按鈕屬性意味着你正在自定義單選按鈕..爲此,你必須製作一個具有特定背景,你想要顯示的圖像,然後s等等。 –