自定义 Indeterminate ProgressBar:
先定义一个ring shape
custom_progress_bar.xml
<?xml version="1.0" encoding="utf-8"?>
<rotate xmlns:android="http://schemas.android.com/apk/res/android"
android:duration="4000"
android:fromDegrees="0"
android:pivotX="50%"
android:pivotY="50%"
android:toDegrees="1440">
<shape
android:innerRadius="9dp"
android:shape="ring"
android:thickness="2dp"
android:useLevel="false">
<size
android:width="22dp"
android:height="22dp" />
<gradient
android:centerColor="#991994EC"
android:centerY="0.5"
android:endColor="#1DB2EE"
android:startColor="#00ec7e2a"
android:type="sweep"
android:useLevel="false" />
</shape>
</rotate>
直接在layout中使用
<ProgressBar
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:indeterminateDrawable="@drawable/custom_progress_bar"
android:minWidth="25dp" />
注意定义上面的android:minWidth,可以调整ProgressBar的Padding效果
5.0以上,自定义progressbar的颜色,可以简单使用:
android:indeterminateTintMode="src_atop"
android:indeterminateTint="@color/your_customized_color"
分享到:
相关推荐
IndeterminateProgressBar,仿WIN8 的圆形加载进度条
来源:Licence:Custom平台:iOS设备:iPhone / iPad作者:Tejaswi Y 实现类似Oink应用的进度条效果。即有一个小球在进度条中滚来滚去,表示某些动作正在进行中。具体效果请看视频。 小编注:改良之后的代码:...
A small Android library allowing you to have a smooth and customizable horizontal indeterminate ProgressBar
Mode是工作模式,有三个取值: INDETERMINATE :不确定模式,此时进度条将无限循环播放 ONESHOT:一次通过模式,此时进度条自动进行一次往返播放 DETERMINATE:确定模式,这中模式下你可以手动控制进度,每调用一...
有线性的进度条,有虚线的进度条,而且颜色还可以自定义的,可以说是一个非常不错的线性的进度条的效果了,该效果主要是SmoothProgressBar实现indeterminate progressbar的效果的,大家可以收藏起来吧。 Small ...
有线性的进度条,有虚线的进度条,而且颜色还可以自定义的,可以说是一个非常不错的线性的进度条的效果了,该效果主要是SmoothProgressBar实现indeterminate progressbar的效果的,大家可以收藏起来吧。
indeterminate-checkbox Android CheckBox and RadioButton with additional 3rd 'indeterminate' state. Requirements Based on AppCompat library Requires AppCompat theme API 7 (but tested only on API ...
Wheel ProgressBar(滚动式进度条),在原生的 android 进度条中只有 indeterminate 式的滚动进度条,现在我们来实现一个 determinate 式进度条,就是可以显示具体进度的滚动式进度条。我们分三个步骤来讲解: 1、...
本文实例讲述了Android编程ProgressBar自定义样式之动画模式实现方法。分享给大家供大家参考,具体如下: 忘记在哪里看到的那位仁兄写的,就是通过用动画效果来实现的,... android:indeterminate=false android:ind
对于indeterminate和v-model绑定的hdIsIndeterminate和hdCheckAll的值 如果true true 或者 true false样式为- 如果false true样式为√ 如果false false样式为不勾 效果如下: -1>{{item.label}} 禁止编辑的时候...
CheckBox的indeterminate是一个独立的属性,和CheckBox的checked、status的取值无关,也就是说它只会影响CheckBox的外观显示,我们仍然可以正常的使用脚本读取checked和status的值
要求AngularJS用法你可以从那里得到它bower install angular-ui-indeterminate 将脚本文件加载到您的应用程序中:< script type =" text/javascript " src =" bower_components/angular/angular.js " > </ ...
指数型的不定式极限,肖劲森,,指数型不定式极限是较为常见不定式极限,其极限存在时可能取任一实数。然而更多人关注的是在什么条件下其极限为$1$。本文将考虑 $0^0
Wheel ProgressBar(滚动式进度条),在原生的 android 进度条中只有 indeterminate 式的滚动进度条,现在我们来实现一个 determinate 式进度条,就是可以显示具体进度的滚动式进度条... ... 一个自定义圆环滚动式...
SnackProgressBar Enhanced Snackbar for Android. Important v5.0 is a migration to androidx from v4.1....Two types of ProgressBar (TYPE_HORIZONTAL and TYPE_CIRULAR) are available (see ima
android:id="@+id/cp_progressbar" android:layout_width="42dp" android:layout_height="42dp" android:layout_centerHorizontal="true" android:layout_centerVertical="true" android:indeterminate="true...
Most of spatial phenomena like natural vegetation units and land use areas constantly change over time and have uncertainty spatial extents. Till now, a considerable number of data models have been ...
RefreshActionItem An action bar item that implements this common pattern: ... The progress bar can also be made indeterminate, just like the built-in ProgressBar. It is possible to add a smal