First on a picture can be seen, the title Color of the dialog box is blue, the following is also a line is blue, in some cases, we want to change the theme of the program style, color must be modified, but also lazy to customize dialog, the following method was born:
public static final void Dialogtitlelinecolor (Dialog Dialog, int color) { Context context = Dialog.getcontext (); /*int Divierid = Context.getresources (). Getidentifier ("Android:id/titledivider", NULL, NULL); View divider = Dialog.findviewbyid (Divierid); Divider.setbackgroundcolor (color); */ int divierid = Context.getresources (). Getidentifier ("Android:id/ Alerttitle ", NULL, NULL); TextView divider = (TextView) Dialog.findviewbyid (Divierid); Divider.settextcolor (backgroundcolor); }
This method can change the caption color of the dialog box and the line color below the title, where changing the horizontal line color has been commented out by me.
Extrapolate, you want to change what properties of the system control can be passed, the context obtains the resource ID, then gets an instance of the resource, and finally modifies the instance's properties. The modified effect is as follows
Android came out after 5.0 material design, I also took a long time to do the app using material design renovated a bit! Welcome to download Use!
http://shouji.baidu.com/soft/item?docid=6936655
How Android can make changes to the system's own dialog box title bar