How to change theme for AlertDialog

前端 未结 15 2065
名媛妹妹
名媛妹妹 2020-11-22 09:14

I was wondering if someone could help me out. I am trying to create a custom AlertDialog. In order to do this, I added the following line of code in styles.xml



        
15条回答
  •  無奈伤痛
    2020-11-22 09:27

     
    
    
    
    
    
    new AlertDialog.Builder(new ContextThemeWrapper(context,R.style.AlertDialogCustom))
                .setMessage(Html.fromHtml(Msg))
                .setPositiveButton(posBtn, okListener)
                .setNegativeButton(negBtn, null)
                .create()
                .show();
    

提交回复
热议问题