中的TextView的文字大小动画 [英] animation of TextView's text size

查看:1448
本文介绍了中的TextView的文字大小动画的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我希望能够做一个文字动画,改变文本的大小在一个TextView。我看有android的财产的动画,但如果有人知道一个简单的code,可以做到这一点对我来说还是一个例子地方我会深深AP preciate它。感谢ü提前!

I want to be able to do a text animation and change the size of the text in a TextView. I read that there are property animations in android but if someone knows a simple code that can do this for me or an example somewhere I will deeply appreciate it. Thank u in advance!

推荐答案

scale.xml

scale.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>

一个功能于活动:

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);
}

提取并从<改性href="http://android10.org/index.php/articlesgraphicsaudiovideo/272-more-animation-in-android-part-2">here

这篇关于中的TextView的文字大小动画的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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