想像google play store一样使用progressbar。
首先,它(进度条)是不确定的——它显示为一个不断移动的加载。然后它显示进度 - 从 0 到 100
在我的案例中,栏仅显示不确定或进度 - 取决于 xml-config。 有什么建议吗?
我的进度条: 这里的条形图显示短时间内的移动负载。下载开始时,进度条自己消失了。 没有 android:indeterminate="true"没有不确定,并且栏只显示进度。 Progress 我通过 progress.setProgress((int) _self.currentProgress); 改变;
<ProgressBar
android:id="@+id/progress"
android:indeterminate="true"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_marginTop="5dip"
style="@style/ProgressBarHoloHorizontal"/>
风格:
<style name="ProgressBarHoloHorizontal">
<item name="android:indeterminateOnly">false</item>
<item name="android:indeterminateDrawable">@drawable/progress_indeterminate_horizontal_holo</item>
<item name="android:minHeight">16dip</item>
<item name="android:maxHeight">16dip</item>
<item name="android:progressDrawable">@drawable/progress_horizontal_holo_light</item>
</style>
最佳答案
使用这个
progress.setIndeterminate(false);
从不确定的变成确定的进度条
关于android - 进度条 : indeterminate + show progress (like google play store),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17213206/