Mer*_*aya 3 android radio-group
如果我最初预选多个 RadioButton,Android API Level 24(模拟器)似乎允许多选。我只想知道这是否是一个错误?
这是布局文件:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical" android:layout_width="match_parent"
android:layout_height="match_parent">
<RadioGroup
android:id="@+id/radioGroup"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<RadioButton
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/metal"
android:checked="true"/>
<RadioButton
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/classical"
android:checked="true"/>
<RadioButton
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/jazz"/>
</RadioGroup>
</LinearLayout>
Run Code Online (Sandbox Code Playgroud)
该应用程序启动如下:
如果我点击 Jazz,它会变成这样:
| 归档时间: |
|
| 查看次数: |
2308 次 |
| 最近记录: |