I changed the color of an AlertDialog title using this command
alert.setTitle( Html.fromHtml("<font color='#FF7F27'>Set IP Address</font>"));
But I want to change the color of the line that appear under the title; how can I do that ?
Note: I don't want to use a custom layout
Divider color:
It is a hack a bit, but it works great for me and it works without any external library (at least on Android 4.4).
You can find more dialog's ids in alert_dialog.xml file. Eg.
android:id/alertTitle
for changing title color...UPDATE: Title color
Hack for changing title color:
check this is useful for you...
you get detail from following link.
http://developer.android.com/reference/android/app/AlertDialog.Builder.html#setCustomTitle%28android.view.View%29
CustomDialog.java
title.xml
In the class onCreateView, I put this:
colorPrimary links to our colors.xml file that stores all the colors. Also
d.setTitle
provides a hacky way to set the title colour.If you are creating custom Layout for alert dialog
then you may add like this way easily to change the color
If you don't want a "library" for that, you can use this badly hack:
This was tested and work on 4.x; not tested under, but if my memory is good it should work for 2.x and 3.x
If your using custom title layout then you can use it like alertDialog.setCustomTitle(customTitle);
For example