Android修改Toast消息提示框字体大小

Toast大小主要由系统负责,但可能有些厂商没有进行适配,需要调整Toast大小。

调整Toast字体大小为25:

LinearLayout linearLayout = (LinearLayout) toast.getView();  

TextView messageTextView = (TextView) linearLayout.getChildAt(0);  

messageTextView.setTextSize(25);  

获得Toast的LinearLayout,找到TextView,进行大小的设置。

这样弹出的Toast的大小就可以适配,同样也可以提供新的Toast的Layout。

猜你喜欢

转载自ch-kexin.iteye.com/blog/2322300