Android 糟糕的吐司轮换
我想使用下一个代码旋转toast:Android 糟糕的吐司轮换,android,user-interface,rotation,toast,Android,User Interface,Rotation,Toast,我想使用下一个代码旋转toast: Toast toast = Toast.makeText(getApplicationContext(), "This is toast!", Toast.LENGTH_LONG); View toastView = toast.getView(); toastView.setRotation(90); toast.show(); 但在屏幕底部看起来是这样的: 我怎样才能使烤面包看起来好看呢 如果我将自定义值设置为toastView的setWidth()和
Toast toast = Toast.makeText(getApplicationContext(), "This is toast!", Toast.LENGTH_LONG);
View toastView = toast.getView();
toastView.setRotation(90);
toast.show();
但在屏幕底部看起来是这样的:
我怎样才能使烤面包看起来好看呢
如果我将自定义值设置为toastView
的setWidth()
和setHeight()
,所有这些看起来都不错,但我正在寻找更优雅、更普通的方法
请记住,我不想重画toastView的画布(StackOverflow上已经有这样的帖子了),我只想旋转普通的toastView,只需添加:
toastView.setElevation(100);
只需添加:
toastView.setElevation(100);