Android 控件抖动效果

利用Android自带的动画效果,实现控件的抖动效果,效果资源文件shark.xml

1<?xml version="1.0" encoding="utf-8"?> 2<translate xmlns:android="http://schemas.android.com/apk/res/android" 3 android:fromXDelta="0" 4 android:toXDelta="10" 5 android:duration="500" 6 android:interpolator="@anim/cycle_7" 7> 8</translate>

使用非常简单

1Animation shakeAnimation = AnimationUtils.loadAnimation(context, R.anim.shake);//加载动画资源文件 2button.startAnimation(shakeAnimation);
点赞
收藏

评论区

加载中...

相关推荐

android ContextMenu 上下文菜单示例

ch2\_contextmenu.xml:<?xmlversion"1.0"encoding"utf8"?<LinearLayoutxmlns:android"http://schemas.android.com/apk/res/android"android:layout_width"match_p

android Notification 状态栏通知使用示例

ch7\_notification.xml:<?xmlversion"1.0"encoding"utf8"?<LinearLayoutxmlns:android"http://schemas.android.com/apk/res/android"android:layout_width"match_

android WebView 使用实例

主布局文件:<?xmlversion"1.0"encoding"utf8"?<LinearLayoutxmlns:android"http://schemas.android.com/apk/res/android"android:layout_width"match_parent"

Android输入法遮挡了输入框,使用android:fitsSystemWindows="true"后界面顶部出现白条

问题1、页面布局文件:<LinearLayoutxmlns:android"http://schemas.android.com/apk/res/android"android:id"@id/layoutorderdetail"android:layoutwidth"matchparent"android:layoutheigh

360项目

shape资源创建图片(重点)1.resdrawablexxx.xml<shapexmlns:android"http://schemas.android.com/apk/res/android"android:shape"rectangle"

Android toolbar 标题精确居中 不会因返回键偏移

1\.总的布局文件<android.support.design.widget.CoordinatorLayoutxmlns:android"http://schemas.android.com/apk/res/android"xmlns:app"http://schemas.android.com