2017-08-13 125 views
1

我想用下面的代码来旋转敬酒:坏吐司旋转

Toast toast = Toast.makeText(getApplicationContext(), "This is toast!", Toast.LENGTH_LONG); 
View toastView = toast.getView(); 
toastView.setRotation(90); 
toast.show(); 

但它看起来像这样在屏幕的底部:

badly rotated toast

我怎么能强迫敬酒看好?

如果我将自定义值设置为toastViewsetWidth()setHeight(),一切看起来不错,但我正在寻找更优雅和常用的方法。

请记住,我不想重绘toastViewCanvas(在StackOverflow上有这样的帖子),我只想旋转普通的Toast

回答