Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how to change dialog title font size

below is my code work fine only problem is its show so small font size of dialog title how i wil change font size any idea???

Dialog dialog2;
dialog2 = new Dialog(context);
View vLoad = LayoutInflater.from(ActivityHome.this).inflate(R.layout.timer, null);
dialog2.requestWindowFeature(Window.FEATURE_LEFT_ICON);
dialog2.setContentView(vLoad);
dialog2.setTitle( Html.fromHtml("<font color='#ffffff' > Due Alert</font>"));
dialog2.show();
like image 778
user3472001 Avatar asked Feb 03 '26 19:02

user3472001


1 Answers

Try this:

TextView title =  new TextView(context);
        title.setText("Due Alert");
        title.setGravity(Gravity.CENTER);
        title.setTextSize(30);
        title.setBackgroundColor(Color.GRAY);
        title.setTextColor(Color.WHITE);
    dialog2.setCustomTitle(title);
like image 86
jyomin Avatar answered Feb 05 '26 13:02

jyomin



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!