我正在尝试为我的应用添加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>
但我无法在布局中添加任何按钮或其他东西,我试图将其添加到片段但它不起作用,如何解决这个问题?! 感谢