1.
xmlns:android="http://schemas.android.com/apk/res/android">
activity中用法
public class AfActivity extends Activity implements OnClickListener {
private ImageView imageView;
private Button moveButton;
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
imageView = (ImageView) findViewById(R.id.iv_imagemove);
moveButton = (Button) findViewById(R.id.move);
moveButton.setOnClickListener(this);
}
public void onClick(View v) {
// 得到配置文件中的背景文件28
imageView.setBackgroundResource(R.drawable.progress_m);
AnimationDrawable animationDrawable = (AnimationDrawable) imageView
.getBackground();
animationDrawable.start();
}
}
3.一张图片
android:drawable="@drawable/spinner_black_16"
android:pivotX="50%"
android:pivotY="50%"
android:fromDegrees="0"
android:toDegrees="360" />
4.多张图标水平进度条
style="?android:attr/progressBarStyleHorizontal" 定义ProgressBar为水平类型
5.水平进度条
android:id="@android:id/background"
android:drawable="@drawable/footer_navigation"/>
android:angle="270"
android:centerColor="#FFFF8C00"
android:centerY="0.75"
android:endColor="#FF6611"
android:startColor="#FFFFD980" />
6.新浪图标加载
android:clipOrientation="vertical"
android:gravity="bottom" >
android:angle="90"
android:centerColor="#55000000"
android:centerX="0.75"
android:endColor="#55000000"
android:startColor="#55000000" />
代码中 表示进度条方向为竖直向上。 布局中引用即可
android:id="@+id/load_pb"
style="?android:attr/progressBarStyleHorizontal"
android:layout_width="109dp"
android:layout_height="80dp"
android:layout_centerInParent="true"
android:background="@drawable/bkg_pic_clicktoload"
android:max="100"
android:progress="0"
android:progressDrawable="@drawable/loading_pb_drawable" />
2.建立如下一个drawable或者anim文件
android:fromDegrees="0"
android:pivotX="50%"
android:pivotY="50%"
android:toDegrees="360" >
android:innerRadiusRatio="3"
android:shape="ring"
android:thicknessRatio="8"
android:useLevel="false" >
android:centerColor="#043233"
android:centerY="0.5"
android:endColor="#000000"
android:startColor="#ffffff"
android:type="sweep"
android:useLevel="false" />