简体   繁体   中英

how can I change dialog box's title color?

I use dialog box in my app. But I want to change my dialog box title's color. How can I handle it. Thanks...

You can try to extend the default theme and use it in your activity. You need to extend the Theme.Dialog style. find example here

如果使用AlertDialog ,则可以使用setCustomTitle(View)函数(也在Builder中)。

U can create an xml as ur wish.. then in dialog inflate the layout..

    LayoutInflater factory2 = LayoutInflater.from(this);
    final View coloredChangedView= factory2.inflate(R.layout.my_layout, null);
//do other things...
.setView(coloredChangedView);

This way u can customised ur dialog..

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM