Android的 - 有没有办法转动敬酒90度? [英] Android -- Is there a way to rotate a toast 90 degrees?

查看:129
本文介绍了Android的 - 有没有办法转动敬酒90度?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

想不出任何更多的信息来提供。有什么办法?

Can't think of any more info to provide. Is there a way?

推荐答案

作为的 hackbod 的说,你就必须有一个自定义的视图来显示敬酒。

As hackbod said, you would have to have a custom view to display the toast.

我找了几个班,你旋转的标签,您:<一href="http://stackoverflow.com/questions/1258275/vertical-rotated-label-in-android/2599518#2599518"><$c$c>VerticalLabelView CustomTextView

I found a few classes for you that rotates the label for you: VerticalLabelView and CustomTextView

我选择使用后者,并且有这个code。在我自己的应用程序工作:

I chose to use the latter, and had this code working in my own app:

// Creating a new toast object
Toast myToast = new Toast(MyActivity.this);
// Creating our custom text view, and setting text/rotation
CustomTextView text = new CustomTextView(MyActivity.this);
text.SetText("Hello World!");
text.SetRotation(-90, 120, 90);
myToast.setView(text);
// Setting duration and displaying the toast
myToast.setDuration(Toast.LENGTH_SHORT);
myToast.show();

这篇关于Android的 - 有没有办法转动敬酒90度?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆