How to change textcolor in AlertDialog

前端 未结 5 2012
抹茶落季
抹茶落季 2020-11-27 04:02

\"AlertDialog\"

How to change the textcolor in an AlertDialog?



        
5条回答
  •  清歌不尽
    2020-11-27 04:50

    Here are a few steps you can follow:

    1.Add a style and name it whatever you want, in my case it's AlertDialogTheme

    
    

    2.Pass in your style as the second parameter on your AlertDialog.Builder() instance. Note that if you are creating the instance from an Activity, replace the first argument with this

    AlertDialog.Builder builder = new AlertDialog.Builder(requireActivity(), R.style.AlertDialogTheme);
    
    1. View your changes

提交回复
热议问题