android - 进度条 : indeterminate + show progress (like google play store)

标签 android

想像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/

相关文章:

android - 在 Android 中检测声音或语音的开头

android - 当 TextView 从屏幕上隐藏时如何设置工具栏标题?

java - 如何在 Android 中的所有 Activity 中维护变量?

c# - Android 的 - performHapticFeedback 与 Vibrator - 文档和使用

java - postDelayed 处理程序不会停止

android - 为什么列表首选项中的条目没有显示在应用程序中?

android - 日历事件保存在手机本地,但无法同步到 Google 日历

c# - Unity3d Swipe 跳转不是很灵敏

android - 共享首选项未保存

Android WebKit 和 JavaServer Faces