How to create a Custom Dialog box in android?

后端 未结 22 2768
囚心锁ツ
囚心锁ツ 2020-11-21 07:06

I want to create a custom dialog box like below

\"enter

I have tried the foll

22条回答
  •  终归单人心
    2020-11-21 07:49

    Simplest way to change the background color and text style is to make custom theme for android alert dialog as below :-

    : Just put below code to styles.xml :

        
    

    : Now customization thing is done , now just apply to your alertBuilder object :

        AlertDialog.Builder builder = new AlertDialog.Builder(MainActivity.this,R.style.AlertDialogCustom);
    

    Hope , this will help you !

提交回复
热议问题