在kotlin中打开alertDialog,如何设置单选按钮的消息

试图在kotlin中打开一个alertDialog,对话框需要显示标题和一些文本消息以及一些单选按钮列表。

使对话框部分工作,但不能设置消息(正文),如果设置消息,那么单选按钮将不会显示(???)。

我想这可能是alertDialog的限制,或任何人都知道解决?

fun openAlertDialog(title: String, alertMessage: String, items: ArrayList<String>) { val poistion = 0 val alertDilogBuilder = AlertDialog.Builder(activity, R.style.myDialogeTheme) alertDilogBuilder.setTitle(title) //alertDilogBuilder.setMessage(alertMessage) //<== if setMessage the radio button will not show .setSingleChoiceItems(list, poistion, object : DialogInterface.OnClickListener { override fun onClick(dialog: DialogInterface, index: Int) { onSelectedCategory(items[index]) Toast.makeText(activity.applicationContext, items[index], Toast.LENGTH_SHORT).show() dialog.dismiss() } }) alertDialog = alertDilogBuilder.create() alertDialog.setButton(AlertDialog.BUTTON_POSITIVE, “Ok", { dialogInterface, i -> onSelectedCategory(items[0]) }) alertDialog.setButton(AlertDialog.BUTTON_NEUTRAL, "Cancel", { dialogInterface, k -> dialogInterface.dismiss() }) alertDialog!!.show() }