【问题标题】:TextView Rotation on Gingerbread姜饼上的TextView旋转
【发布时间】:2013-03-25 13:06:52
【问题描述】:

在 Honeycomb 及更高版本上,我可以轻松地将 TextView 旋转为度数:

android:rotation(90)

但这在 Honeycomb 下、Gingerbread 和 Froyo 上不起作用。

我可以用什么代替?

【问题讨论】:

    标签: android android-layout android-widget textview android-2.3-gingerbread


    【解决方案1】:

    您可以在anim文件夹中声明旋转动画

    下面的 sn-p 会帮助你。

    textanim.xml

       <?xml version="1.0" encoding="utf-8"?>
       <rotate xmlns:android="http://schemas.android.com/apk/res/android"
            android:fromDegrees="10" android:toDegrees="90" android:pivotX="50%"
            android:duration="100">
       </rotate>
    

    内部代码

    TextView tv = (TextView)findViewById(R.id.text);
    tv.setAnimation(AnimationUtils.loadAnimation(this,R.anim.textanim));
    

    【讨论】:

    • textview 在 Widget 上时是否可以这样做?
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2023-04-04
    相关资源
    最近更新 更多