Android的水平进度条和圆形进度条实例
2013-08-18 13:00
323 查看
1 Activity
package com.example.b;
import android.app.Activity;
import android.os.Bundle;
public class ProcessActivity extends Activity{
@Override
protected void onCreate(Bundle savedInstanceState) {
// TODO Auto-generated method stub
super.onCreate(savedInstanceState);
this.setContentView(R.layout.process);
}
}
2 主layout
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical" >
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="圆形" />
<ProgressBar
android:id="@+id/progress_bar"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="水平进" />
<ProgressBar
android:id="@+id/progress_horizontal"
style="?android:attr/progressBarStyleHorizontal"
android:layout_width="200dip"
android:layout_height="wrap_content"
android:max="100"
android:progress="50"
android:secondaryProgress="75" />
</LinearLayout>3 效果图
package com.example.b;
import android.app.Activity;
import android.os.Bundle;
public class ProcessActivity extends Activity{
@Override
protected void onCreate(Bundle savedInstanceState) {
// TODO Auto-generated method stub
super.onCreate(savedInstanceState);
this.setContentView(R.layout.process);
}
}
2 主layout
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical" >
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="圆形" />
<ProgressBar
android:id="@+id/progress_bar"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="水平进" />
<ProgressBar
android:id="@+id/progress_horizontal"
style="?android:attr/progressBarStyleHorizontal"
android:layout_width="200dip"
android:layout_height="wrap_content"
android:max="100"
android:progress="50"
android:secondaryProgress="75" />
</LinearLayout>3 效果图
相关文章推荐
- Android 带百分比数字的水平、圆形进度条
- [Android实例] 自定义漂亮的圆形进度条
- Android ProgressBar高级自定义水平/圆形进度条
- Android自定义View实现音频播放圆形进度条
- Android 自定义圆形进度条
- android progressbar 水平进度条
- 【Android 应用开发】 自定义 圆形进度条 组件
- Android实现带数字的圆形进度条(自定义进度条)
- Android 高手进阶之自定义View,自定义属性(带进度的圆形进度条)
- Android自定义的圆形进度条
- Android自定义圆形进度条
- 【Android自定义view系列】圆形百分比进度条
- Android 自定义控件一 带圆形进度的按钮 ControlButton2
- Android自定义控件系列之应用篇——圆形进度条
- Android CircleProgress:可自由定制实现各种样式圆形加载进度
- Android 自定义漂亮的圆形进度条
- android圆形进度条ProgressBar颜色设置
- Android自定义View实现带百分比圆形进度条
- Android自定义圆形加载进度条
- Android自定义进度条-带文本(文字进度)的水平进度条(ProgressBar)