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

前端 未结 9 1810
别那么骄傲
别那么骄傲 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:37

    You can add custom colour to button. Below your code

    builder.show();
    

    Write this

    Button bg = dialog.getButton(DialogInterface.BUTTON_POSITIVE);
    bg.setTextColor(Color.BLUE);
    

提交回复
热议问题