android拉下来刷新布局

时间:2015-01-28 02:57:24

标签: android pull-to-refresh

我正在尝试为我的应用添加pull to refresh,这是我找到的代码

<android.support.v4.widget.SwipeRefreshLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/swipe_layout"
android:layout_width="match_parent"
android:layout_height="match_parent" >

<ScrollView
    android:layout_width="match_parent"
    android:layout_height="match_parent" >

    <TextView
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_marginTop="25dp"
        android:gravity="center_horizontal"
        android:text="Pull to Refresh" />
</ScrollView>

但我无法在布局中添加任何按钮或其他东西,我试图将其添加到片段但它不起作用,如何解决这个问题?! 感谢

0 个答案:

没有答案