How can we increase the font size in toast?

前端 未结 7 588
谎友^
谎友^ 2021-01-31 15:15

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?

相关标签:
7条回答
  • 2021-01-31 16:15

    Here is how to do that with spans:

    SpannableStringBuilder biggerText = new SpannableStringBuilder(text);
    biggerText.setSpan(new RelativeSizeSpan(1.35f), 0, text.length(), 0);
    Toast.makeText(context, biggerText, Toast.LENGTH_LONG).show();
    
    0 讨论(0)
提交回复
热议问题