坏吐司轮换

时间:2017-08-13 18:37:20

标签: android user-interface rotation toast

我想使用下一个代码旋转烤面包片:

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

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

badly rotated toast

我怎样才能强制举杯祝酒?

如果我将自定义值设置为toastView的{​​{1}}和setWidth(),那么一切看起来都不错,但我正在寻找更优雅和更常见的方式。

请注意,我不想重新绘制setHeight()的{​​{1}}(已经在StackOverflow上发布了这样的帖子),我只想转动普通的toastView

1 个答案:

答案 0 :(得分:0)

只需添加:

toastView.setElevation(100);

API reference