Set AlertBox Title Bar Background Color

后端 未结 3 1873
孤独总比滥情好
孤独总比滥情好 2021-02-14 20:58

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:44

    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

    
        
    
            
        
    
    

提交回复
热议问题