Animation 加载动画的创建
创建 anim目录 loading_animation.xml
<?xml version="1.0" encoding="utf-8"?>
<set xmlns:android="http://schemas.android.com/apk/res/android">
<rotate
android:interpolator="@android:anim/linear_interpolator"
android:pivotX="50%"
android:pivotY="50%"
android:fromDegrees="0"
android:toDegrees="+360"
android:duration="1500"
android:startOffset="-1"
android:repeatMode="restart"
android:repeatCount="-1"/>
</set>
activity调用
private Animation animation;
private ImageView pb;
// 开始加载数据时调用
animation = AnimationUtils.loadAnimation(WebViewActivity.this,
R.anim.cirle);
pb.startAnimation(animation);// 启动
// 数据加载完后调用
pb.clearAnimation();// 清除
pb.setVisibility(View.GONE);// 隐藏