How to implement a custom AlertDialog View

前端 未结 11 1049
悲&欢浪女
悲&欢浪女 2020-11-22 13:18

In the Android docs on AlertDialog, it gives the following instruction and example for setting a custom view in an AlertDialog:

If you want to display a
11条回答
  •  北荒
    北荒 (楼主)
    2020-11-22 13:52

    This worked for me:

    dialog.setView(dialog.getLayoutInflater().inflate(R.layout.custom_dialog_layout, null));
    

提交回复
热议问题