【问题标题】:create a Circular progressbar with circular background创建一个圆形背景的圆形进度条
【发布时间】:2015-03-20 12:36:20
【问题描述】:

see this Image

我想创建一个新的向下滑动刷新进度条。一个圆圈和一个箭头在里面旋转,就像 Gmail 应用一样。示例图像如上所示。

【问题讨论】:

  • 嗨伙计,我刚刚回答了下面的问题。使用“向下滑动刷新”一词编辑和改进您的问题,然后只关注问题。
  • 我认为 stackoverflow 中没有这个问题,所以如果这个问题很受欢迎会更好。

标签: android xml android-progressbar


【解决方案1】:

这称为向下滑动刷新,要实现这一点,您必须使用 android.support.v4.widget.SwipeRefreshLayout

我们需要做的第一件事是将支持库添加到我们应用程序的 build.gradle 文件中。

compile 'com.android.support:support-v4:21.0.+'

然后我们必须创建一个这样的布局。

<android.support.v4.widget.SwipeRefreshLayout
        android:id="@+id/activity_main_swipe_refresh_layout"
        android:layout_width="match_parent"
        android:layout_height="wrap_content">

        <ListView
            android:id="@+id/activity_main_listview"
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            >
        </ListView>

    </android.support.v4.widget.SwipeRefreshLayout>

您可以通过代码找到一个很棒的教程here

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2020-11-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多