Android 6.0 Dialog text doesn't appear

后端 未结 11 2099
感情败类
感情败类 2020-12-15 17:02

I updated my phone to Android 6.0 and I have these 2 problems with dialogs:

1)The title is shown but the messages isn\'t for alert dialog(SOLVED):

          


        
11条回答
  •  一生所求
    2020-12-15 17:24

    i tried to fix this problem by making a style of my own.

    your dialog object should be like this and your style pointed to this Dialog will be written below

    new AlertDialog.Builder(new ContextThemeWrapper(Context, R.style.Dialog))
                .setTitle("Title")
                .setMessage("Sample Message ...").show();
    

    R.style.Dialog ::

    
    

    Colors ::

    #212121
    #2196f3
    

    finally the output should be something like this

    Note : "android:textColorPrimary" goes for dialog setMessage and "android:textColor" goes for dialog setTitle ; i do not use setPositive and setNegative button and listener in my dialog object but you can see them in the picture if you want you can make your own dialog object.

提交回复
热议问题