Set AlertBox Title Bar Background Color

后端 未结 3 725
囚心锁ツ
囚心锁ツ 2021-02-14 21:11

How can I change the background color for an alertbox\'s title bar?

AlertDialog.Builder alert=new AlertDialog.Builder(getParent());
alert.setTitle(\"sample\");
a         


        
3条回答
  •  不知归路
    2021-02-14 21:55

    You can just set custom title like this

    LayoutInflater inflater = this.getLayoutInflater();
    View titleView = inflater.inflate(R.layout.custom_title, null);
    
    new AlertDialog.Builder(SubCategoryActivity.this)
                        .setCustomTitle(titleView);
    

    and in custom_title layout you can create custom title like this

    
        
    
            
        
    
    

提交回复
热议问题