AlertDialog styling - how to change style (color) of title, message, etc

前端 未结 8 1362
醉梦人生
醉梦人生 2020-12-04 14:31

I\'ve breaking my head over this quite a bit. What I need to do is, change the style of all AlertDialogs in my android application - dialog background needs to

相关标签:
8条回答
  • 2020-12-04 15:14

    Building on @general03's answer, you can use Android's built-in style to customize the dialog quickly. You can find the dialog themes under android.R.style.Theme_DeviceDefault_Dialogxxx.

    For example:

    builder = new AlertDialog.Builder(this, android.R.style.Theme_DeviceDefault_Dialog_MinWidth);
    builder = new AlertDialog.Builder(this, android.R.style.Theme_DeviceDefault_Dialog_NoActionBar);
    builder = new AlertDialog.Builder(this, android.R.style.Theme_DeviceDefault_DialogWhenLarge);
    
    0 讨论(0)
  • 2020-12-04 15:17

    It depends how much you want to customize the alert dialog. I have different steps in order to customize the alert dialog. Please visit: https://stackoverflow.com/a/33439849/5475941

    0 讨论(0)
提交回复
热议问题