Set the title background color of alert dialog wit

2019-06-11 11:56发布

I am using the alert dialog builder and I would like to change the default alert dialog title background color. I have done searches on it (but couldnt find what I want). The thing is that I don't want to create custom dialog and extend it as I want to use the existing functionality of alert dialog (setting items list ..etc).

Is there anyway I can set the title background color without having to create a custom dialog/add views to it .etc?

Thank you very much

1条回答
相关推荐>>
2楼-- · 2019-06-11 12:09

You can set custom title by using setCustomTitle(view)

LayoutInflater inflater = getLayoutInflater();
View view=inflater.inflate(R.layout.custom_view, null);
alert.setCustomTitle(view);
查看更多
登录 后发表回答