六狼论坛

 找回密码
 立即注册

QQ登录

只需一步,快速开始

新浪微博账号登陆

只需一步,快速开始

搜索
查看: 15|回复: 0

文本抖动效果

[复制链接]

升级  35.2%

212

主题

212

主题

212

主题

进士

Rank: 4

积分
676
 楼主| 发表于 2013-2-3 10:31:22 | 显示全部楼层 |阅读模式
几句代码如下:
Animation animation = AnimationUtils.loadAnimation(this, R.anim.shake);EditText editText = (EditText) findViewById(R.id.edittext); editText.startAnimation(animation);

shake.xml:
里面面的fromXDelta,toXDelta是表示x轴方向的移动距离
<translate xmlns:android="http://schemas.android.com/apk/res/android"android:fromXDelta="0" android:toXDelta="30" android:duration="1000"android:interpolator="@anim/cycle_interpolator" />

cycleInterpolator.xml文件:
<cycleInterpolator xmlns:android="http://schemas.android.com/apk/res/android"android:cycles="3" />
您需要登录后才可以回帖 登录 | 立即注册 新浪微博账号登陆

本版积分规则

快速回复 返回顶部 返回列表