android - TextView 文本大小的动画

标签 android animation text size textview

我希望能够制作文本动画并更改 TextView 中文本的大小。我读到 android 中有属性动画,但如果有人知道可以为我做这个的简单代码或某个地方的示例,我将非常感激。提前谢谢你!

最佳答案

规模.xml

<?xml version="1.0" encoding="utf-8"?>
<set
    xmlns:android="http://schemas.android.com/apk/res/android">
    <scale
          android:fromXScale="1.0"
          android:fromYScale="1.0"
          android:toXScale="2.0"
          android:toYScale="2.0"
          android:duration="3000"></scale>
</set>

Activity 中的函数:

private void RunAnimation() 
{
    Animation a = AnimationUtils.loadAnimation(this, R.anim.scale);
    a.reset();
    TextView tv = (TextView) findViewById(R.id.firstTextView);
    tv.clearAnimation();
    tv.startAnimation(a);
}

here中提取和修改

关于android - TextView 文本大小的动画,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7677250/

相关文章:

java - Android Facebook 注销错误(未知方法)

android - 如何将一个runnable放入bundle中?

python - 如何暂停/恢复 matplotlib 艺术家动画

php - 在php中读取文本文件并使用其内容从mysql数据库中获取数据

android - 手势识别器和 AndEngine (Android)

java - android.view.ContextThemeWrapper 无法转换为 android.app.Activity

javascript - jQuery text() 忽略前导空格

android - 在 Android 中禁用文本的默认 css 设置

jquery - 如何将 CSS 动画更改为 jquery animate() 代码?

python - matplotlib 动画期间的异常