I'm trying to add pull to refresh for my app , this is code that I found
<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>
but I can't add any buttons or other thing inside the layout , I tried to add it to fragment but it doesn't work , how to solve this?! thanks