【问题标题】:Issues with the Material ProgressBar材质进度条的问题
【发布时间】:2014-11-27 08:51:51
【问题描述】:

我在我的一个活动中发现了 Material Design ProgressBar 的一个奇怪问题。动画运行并不顺利,如下所示:http://gfycat.com/RadiantFocusedAuk。值得一提的是,这只发生在我的一个 ProgressBars 上。其他的则按应有的方式显示。

这个布局很简单:

<LinearLayout
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:orientation="horizontal">

    <TextView
        android:id="@+id/detail_loan_statustext"
        android:layout_width="0dp"
        android:layout_height="wrap_content"
        android:layout_weight="1"
        android:layout_gravity="center_vertical"
        android:padding="8dp"/>

    <ProgressBar
        android:id="@+id/detail_loan_progress"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_gravity="center_vertical"
        style="?android:attr/progressBarStyle"/>

    <Button
        android:id="@+id/detail_loan_button"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_gravity="center_vertical"
        android:layout_margin="8dp"/>

</LinearLayout>

我尝试稍微调整一下样式,结果发现只有在使用 Material-Style 时才会发生这种行为。使用 Holo-Style 将使 ProgressBar 正确动画。

还有其他人遇到过类似的问题吗?

有没有办法摆脱这种情况?

【问题讨论】:

    标签: android android-layout material-design


    【解决方案1】:

    这似乎是 5.0.0 中的一个问题。 5.0.1 不再出现此问题。

    【讨论】:

      【解决方案2】:

      我在link 中发现了一些有趣的东西,我想它会解决你的问题。

      <com.gc.materialdesign.views.ProgressBarCircularIndetermininate
                  android:id="@+id/progressBarCircularIndetermininate"
                  android:layout_width="32dp"
                  android:layout_height="32dp"
                  android:background="#1E88E5" />
      

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 1970-01-01
        • 2019-05-28
        • 1970-01-01
        • 2016-11-05
        • 2018-07-29
        • 1970-01-01
        • 1970-01-01
        • 2019-09-21
        相关资源
        最近更新 更多