Missing buttons on AlertDialog | Android 7.0 (Nexus 5x)

前端 未结 9 1798
别那么骄傲
别那么骄傲 2020-12-05 13:19

I am trying to create an AlertDialog but the buttons are not showing. Only seeing this issue in Android 7.0:

final AlertDialog.Builder builder =         


        
9条回答
  •  长情又很酷
    2020-12-05 13:44

    Maybe its too late, but I hope someone would use this solution. you can do it something like this: You should set onShowListenter to your alertDialog, inside this function you should getButton() and than setTextColor to it. An example:

    alertDialog = alertDialogBuilder.create();
    alertDialog.setOnShowListener(new DialogInterface.OnShowListener(){
        @Override
        public void onShow(DialogInterface dialogInterface){
            alertDialog.getButton(AlertDialog.BUTTON_POSITIVE).setTextColor(R.color.black);
        }
    });
    

提交回复
热议问题