您需要添加RadioGroup中標籤裏面單選按鈕在烏拉圭回合對話xml文件。
custom_dialog.xml
<RadioGroup
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/RGroup">
<RadioButton
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Blue Theme"
android:id="@+id/bluetheme"/>
<RadioButton
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Black Theme"
android:id="@+id/blacktheme"/>
<RadioButton
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Brown Theme"
android:id="@+id/browntheme" />
<RadioButton
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Orange Theme"
android:id="@+id/orangetheme"/>
</RadioGroup>
只是重視這個XML與對話片段......這僅僅是簡單的example..u可以在烏拉圭回合的方式也
public class DFragment extends DialogFragment {
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
View rootView = inflater.inflate(R.layout.custom_dialog, container,
false);
getDialog().setTitle("DialogFragment Tutorial");
// Do something else
return rootView;
}
}
對不起。但你想添加複選框/單選按鈕?併爲他們的聽衆? –
單選按鈕@aa_oo –
@JamesOla檢查我的更新和 –