我已經創建按鈕成功,但現在我想每個按鈕有一個單選按鈕下面我做了即時通訊應該做的但仍然不工作的錯誤是說沒有資源標識符爲屬性權重找到和這錯誤顯示在三個單選按鈕創建RadioButton沒有結果
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android2="http://schemas.android.com/apk/res/android"
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical" >
<LinearLayout
android:id="@+id/linearLayout1"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:weightSum="10" >
<TextView
android:id="@+id/secondLine"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="@string/Greetings"
android:textSize="20sp" />
<Button
android:id="@+id/Button1"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="@string/hello" />
</LinearLayout>
<LinearLayout
android:id="@+id/linearLayout2"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="5dp"
android:orientation="horizontal"
android:weightSum="10" >
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="3.3"
android:background="#ff0000"
android:gravity="center"
android:text="@string/red"
android:textColor="#000000" />
<TextView
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_weight="3.4"
android:background="#00ff00"
android:gravity="center"
android:text="@string/green"
android:textColor="#000000" />
<TextView
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_weight="3.3"
android:background="#0000ff"
android:gravity="center"
android:text="@string/blue"
android:textColor="#000000" />
</LinearLayout>
<RadioGroup
android:id="@+id/myRadioGroup"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="horizontal" >
<RadioButton
android:id="@+id/myRadioButtonRed"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:weight="1" />
<RadioButton
android:id="@+id/myRadioButtonGreen"
style="@style/styleName"
android:layout_width="fill_parent"
android:layout_height="fill_parent" />
<RadioButton
android:id="@+id/myRadioButtonBlue"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:weight="1" />
</RadioGroup>
你到底想幹什麼? – Pavlos
真的想妳想要 –
我想讓單選按鈕在textview下方(紅色,藍色,綠色) –