Eagle_Eye Eagle_Eye - 7 days ago 6
Android Question

Change Title Font Of Alert Dialog Box Android

I Want To Change The Font Of The Title Of Alert Dialog Box..

Can Anybody Tell How Can I Do It..?

Any Help Would Be Appreciated..

Answer

I found a simple solution..

At first I was setting the title of my alert box by

builder.setTitle("My Title");

So I was not able to change the font of it..

Then what worked for me is..

I created a simple TextView :

TextView tv2;

And set all properties of TextView which I wanted...

And then I replaced my

builder.setTitle("My Title");

line with

builder.setCustomTitle(tv2);

and now I can change Title Color, Font Etc By Changing tv2's Properties..

Comments