And*_*Dev 1 android android-alertdialog material-design material-components material-components-android
如何在 AlertDialog.Only AlertDialog 中显示项目,没有任何项目我正在尝试下面的代码,但这似乎不起作用:
CharSequence[] choices = {"Choice1", "Choice2", "Choice3"};
AlertDialog.Builder alertDialogBuilder = new AlertDialog.Builder(context)
.setTitle(context.getString(R.string.title))
.setPositiveButton(context.getString(R.string.Ok), null)
.setNeutralButton(context.getString(R.string.Cancel), null)
.setSingleChoiceItems(choices, 1, null);
AlertDialog alertDialog = alertDialogBuilder.create();
alertDialog.show();
Run Code Online (Sandbox Code Playgroud)
我正在使用材料组件样式:
<style name="AppTheme" parent="Theme.MaterialComponents.Light.DarkActionBar">
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
893 次 |
| 最近记录: |