控件——ProgressBar
来源:互联网 发布:java培训贷款骗局流程 编辑:程序博客网 时间:2024/06/05 15:48
左上是ProgressBar的 垂直风格 右上是ProgressBar的 水平风格
左下是SeekBar的对象 SeekBar是ProgressBar的子类
右下是RatingBar的对象 RatingBar是ProgressBar的子类
<ProgressBar android:layout_width="wrap_content" android:layout_height="wrap_content" android:id="@+id/firstProgressBarId" style="?android:attr/progressBarStyleSmall"/> <ProgressBar android:layout_width="wrap_content" android:layout_height="wrap_content" android:id="@+id/secondProgressBarId" style="?android:attr/progressBarStyleInverse" android:layout_below="@id/firstProgressBarId"/> <ProgressBar android:layout_width="match_parent" android:layout_height="wrap_content" android:max="200" android:progress="100" android:secondaryProgress="150" android:id="@+id/thirdProgressBarId" android:layout_below="@id/secondProgressBarId" style="?android:attr/progressBarStyleHorizontal"/> <SeekBar android:layout_width="wrap_content" android:layout_height="wrap_content" android:id="@+id/forthProgressBarId" android:layout_below="@id/thirdProgressBarId"/> <RatingBar android:layout_width="wrap_content" android:layout_height="wrap_content" android:id="@+id/fifthProgressBarId" android:layout_below="@id/forthProgressBarId"/>
style=”?android:attr/progressBarStyleHorizontal”
表示的是水平风格
默认为垂直风格
style=”?android:attr/progressBarStyleInverse”
表示的是反向风格
适用于activity底色为白色的界面
public class MainActivity extends AppCompatActivity { private ProgressBar progressBar; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); progressBar = (ProgressBar)findViewById(R.id.firstProgressBarId); //判断当前 progressBar 是否是 明确的 //所谓明确 也就是 水平风格是明确的 垂直风格不是明确的 boolean flag = progressBar.isIndeterminate(); //表示 在当前ProgressBar 主进度基础上 增加 10 progressBar.incrementProgressBy(10); ////表示 在当前ProgressBar 第二进度基础上 增加 10 progressBar.incrementSecondaryProgressBy(10); } @Override public boolean onCreateOptionsMenu(Menu menu) { // Inflate the menu; this adds items to the action bar if it is present. getMenuInflater().inflate(R.menu.menu_main, menu); return true; } @Override public boolean onOptionsItemSelected(MenuItem item) { // Handle action bar item clicks here. The action bar will // automatically handle clicks on the Home/Up button, so long // as you specify a parent activity in AndroidManifest.xml. int id = item.getItemId(); //noinspection SimplifiableIfStatement if (id == R.id.action_settings) { return true; } return super.onOptionsItemSelected(item); }}
0 0
- 控件——ProgressBar
- android控件——ProgressBar
- Activity常见控件三——progressBar
- Android学习笔记7——常用控件ProgressBar
- android开发控件——progressbar(入门)
- 【Android】31、常见控件的使用方法——ProgressBar
- C#控件之进度条—progressBar及其相关知识
- ProgressBar控件
- ProgressBar控件
- Android UI系统控件进阶(二)—下拉列表控件Spinner,进度条ProgressBar,滑块控件SeekBar,评分控件RatingBar
- ProgressBar——Marquee
- 入门——progressBar
- WPF—ProgressBar进度条
- Android 程式开发:(十二)最基本的UI控件 —— 12.3ProgressBar
- Visual Studio 2010——C#的ProgressBar和TrackBar控件的使用
- 一步一步学android控件(之二十三)—— ProgressBar
- Android自定义控件——手把手教你写出Google样式的ProgressBar
- android 使用代码方式创建自定义progressBar——自定义控件学习(六)
- hdu2025
- 端口被占用怎么办
- fastjson 工具入门(转载)
- #第一周1004解题报告#
- GUI做出渐进的颜色变化(指定了颜色)
- 控件——ProgressBar
- 重绘Button控件
- phonegap-环境搭建(3)
- HQL
- 自定义标签&JSTL标签库&EL函数
- hdu1209(Clock)
- ubuntu mysql安装和用户登录
- HTML和XML之间的区别
- Session与Cookie解析