anroid Bar 进度条示例
来源:互联网 发布:有机器码破解软件 编辑:程序博客网 时间:2024/06/16 10:40
seekbar.xml:
<?xml version="1.0" encoding="utf-8"?><LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="fill_parent" android:orientation="vertical" > <TextView android:layout_width="fill_parent" android:layout_height="wrap_content" android:text="这是一个滑块的案例"/> <SeekBar android:layout_width="fill_parent" android:layout_height="wrap_content" android:id="@+id/seekBar" android:max="100"/> <TextView android:layout_width="fill_parent" android:layout_height="wrap_content" android:text="这是一个水平进度条的案例"/> <ProgressBar android:layout_width="fill_parent" android:layout_height="wrap_content" android:id="@+id/firstBar" android:max="100" style="?android:attr/progressBarStyleHorizontal"/> <TextView android:layout_width="fill_parent" android:layout_height="wrap_content" android:text="这是一个循环进度条的案例"/> <ProgressBar android:layout_width="wrap_content" android:layout_height="wrap_content" android:id="@+id/secondBar" android:max="100" android:progress="10" style="?android:attr/progressBarStyle"/> <Button android:layout_width="100px" android:layout_height="wrap_content" android:id="@+id/bt_Begn" android:text="开始"/> </LinearLayout>
ProgressBarActivity.java文件:
package com.example.baseexample;import android.app.Activity;import android.os.Bundle;import android.view.View;import android.widget.Button;import android.widget.ProgressBar;import android.widget.SeekBar;public class ProgressBarActivity extends Activity {private SeekBar seekBar;private ProgressBar firstBar;private ProgressBar secondBar;private Button bt_Begin;private int i=0;public void onCreate(Bundle savedInstanceState){super.onCreate(savedInstanceState);setContentView(R.layout.seekbar);seekBar= (SeekBar)findViewById(R.id.seekBar);firstBar = (ProgressBar)findViewById(R.id.firstBar);secondBar = (ProgressBar)findViewById(R.id.secondBar);bt_Begin = (Button)findViewById(R.id.bt_Begn);bt_Begin.setOnClickListener(new Button.OnClickListener(){@Overridepublic void onClick(View v) {if(i==0){firstBar.setVisibility(View.VISIBLE);secondBar.setVisibility(View.VISIBLE);}else if(i<=100){firstBar.setProgress(i);firstBar.setSecondaryProgress(i+10);secondBar.setProgress(i);}i=i+10;seekBar.setProgress(i);}});}}
0 0
- anroid Bar 进度条示例
- 进度条(progress bar)
- 进度条简明基础(Progress Bar)
- Bootstrap—进度条progress-bar
- anroid achartengine折线的示例及问题
- Action Bar示例代码 (一)
- Action Bar示例代码 (一)
- Adnroid 最全的 进度条 progress bar
- anroid
- Python简单进度条示例
- ProgressBar进度条示例
- RatingBar打分进度条示例
- 进度条ProcessBar示例
- Android 中的进度条示例 ProgressDialog
- qt slider scroll bar 进度条 自定义(通过style sheet)
- 纯CSS3进度条制作-Pure CSS3 Progress Bar
- adf学习:进度条的使用(progress bar demo)
- C# Windows 7任务栏开发之进度条(Progress Bar)
- js身份证验证
- 控制线程---线程睡眠:sleep
- 深入研究java.lang.ThreadLocal类
- camera拍摄视频耗电过快的问题分析
- Java中的泛型
- anroid Bar 进度条示例
- 2013企业软件市场预测:MySQL地位遭挑战
- 功能点(Funciton Point FP)估算法(一) 识别项目范围和数据复杂度
- 通过自己写的方法实现不用ajax的POST方法请求(在网上看到的,感觉很实用)
- 获取浏览器大小
- 泪雨跌湿了青春
- 【MVC】MVP模式与MVC模式
- “RPC服务不可用”的解决过程
- 学生角度看待CSDN-2014开源技术大会