Is there any way to increase the font size in toast without customizing?
I don't want to create a layout for increasing the text size.
Is there any way?
Thanks,
Niki
setTextColor(Color. RED); toast. show(); Just change toast text color this way..
If a simple text message isn't enough, you can create a customized layout for your toast notification. To create a custom layout, define a View layout, in XML or in your application code, and pass the root View object to the setView (View) method.
I believe it is achieveable by this:
ViewGroup group = (ViewGroup) toast.getView(); TextView messageTextView = (TextView) group.getChildAt(0); messageTextView.setTextSize(25);
this is ...
Toast toast = Toast.makeText(context, R.string.yummyToast, Toast.LENGTH_SHORT); //the default toast view group is a relativelayout RelativeLayout toastLayout = (RelativeLayout) toast.getView(); TextView toastTV = (TextView) toastLayout.getChildAt(0); toastTV.setTextSize(30); toast.show();
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With