2016-08-18 54 views
0

我想显示一个顶级进度条。进度条出现,它不是动画。ProgressBar not animated

<ProgressBar 
    android:id="@+id/departureProgressBar" 
    style="@style/Widget.AppCompat.ProgressBar.Horizontal" 
    android:indeterminate="true" 
    android:visibility="visible" 
    android:layout_width="fill_parent" 
    android:layout_height="wrap_content" 
    android:layout_alignParentTop="true" 
    android:layout_marginTop="-6dp" /> 

我gradle这个包含:

com.android.support:appcompat-v7:23.4.0 

我的设备具有至少是Android 5.0

任何想法?

编辑:

http://www.materialdoc.com/linear-progress/

进度没有在预先棒棒糖设备材料样式显示。

编辑2:

我的设备是5.1.1,因此它必须正常工作......

+0

测试用例加上'风格=“机器人:???ATTR/progressBarStyleHorizo​​ntal' –

+0

你能看到进度发生了什么 –

+0

删除'安卓layout_marginTop' –

回答

0

它不支持预棒棒糖,但你可以用这个替代library

+0

我可以显示进度条。我试过了,但它仍然没有动画效果。 – Xero

+0

检查上面提到的gradle – Don

+0

我编译'com.android.support:appcompat-v7:23.4.0' – Xero

0

在各自的布局中添加像这样。

<ProgressBar 
       android:id="@+id/progressBar" 
       android:layout_width="wrap_content" 
       android:layout_height="wrap_content" 
       android:layout_centerInParent="true" 
       android:layout_alignParentTop="true"/> 

在您的主要活动中实施它并填写必要的可见性代码。默认情况下它会显示。