anim文件夹下

 1 <?xml version="1.0" encoding="utf-8"?> 2 <set xmlns:android="http://schemas.android.com/apk/res/android" 3     android:shareInterpolator="false" > 4  5     <alpha 6         android:duration="1000" 7         android:fromAlpha="1" 8         android:repeatCount="infinite" 9         android:repeatMode="reverse"10         android:toAlpha="0" />11 12 </set>
View Code

 1 package com.itheima.tween; 2  3 import android.app.Activity; 4 import android.os.Bundle; 5 import android.view.View; 6 import android.view.animation.Animation; 7 import android.view.animation.AnimationUtils; 8 import android.widget.ImageView; 9 10 public class MainActivity extends Activity {11 12     private ImageView imageView;13 14     @Override15     protected void onCreate(Bundle savedInstanceState) {16         super.onCreate(savedInstanceState);17         setContentView(R.layout.activity_main);18         imageView = (ImageView) findViewById(R.id.imageView);19     }20 21     public void alpha(View v) {22         Animation anim = AnimationUtils.loadAnimation(this, R.anim.alpha);    // 加载XML定义动画特效23 //        anim.setFillAfter(true);            // 保持结束时的画面24         imageView.startAnimation(anim);        // 应用动画特效25     }26     27     public void scale(View v) {28         Animation anim = AnimationUtils.loadAnimation(this, R.anim.scale);29         imageView.startAnimation(anim);    30     }31     32     public void rotate(View v) {33         Animation anim = AnimationUtils.loadAnimation(this, R.anim.rotate);34         imageView.startAnimation(anim);    35     }36     37     public void translate(View v) {38         Animation anim = AnimationUtils.loadAnimation(this, R.anim.translate);39         imageView.startAnimation(anim);    40     }41     42     public void combo(View v) {43         Animation anim = AnimationUtils.loadAnimation(this, R.anim.combo);44         imageView.startAnimation(anim);    45     }46 47 }

更多相关文章

  1. Android中让View匀速旋转
  2. Android(安卓)动画中共用的属性!
  3. Android应用开发相关下载资源(2014/12/14更新)
  4. Android应用开发相关下载资源(2014/12/14更新)
  5. AdapterViewFlipper
  6. android 开发者资源下载地址记录(转+补充)
  7. Android(安卓)利用 xml 文件实现 ImageView 的加载转圈动画
  8. Android用户界面 UI组件--AdapterView及其子类(二) AdapterViewA
  9. Android(安卓)Studio Gradle 添加.so 支持文件

随机推荐

  1. Android(安卓)根据显示长度 调整字体大小
  2. 屏蔽apk在主界面上的显示
  3. Android(安卓)Build System
  4. android效果图之轮播
  5. Android(安卓)documentation decompile
  6. android 获取rom名称和版本号
  7. LKM Tricks to Android(安卓)Devices,查
  8. 定制apk名字
  9. Android(安卓)Audio代码分析14 - testPla
  10. Android:Activity:打开另外的Activity、参