我希望能够制作文本动画并更改 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/