Thanks to this author for sharing http://www.cnblogs.com/linjzong/p/5221604.html
If the Swiperefreshlayout sub-layout is a linear layout linearlayout,
<?xml version= "1.0" encoding= "Utf-8"? ><linearlayout xmlns:android= "http://schemas.android.com/apk/res/ Android " android:layout_width=" match_parent " android:layout_height=" match_parent " android:o rientation= "Vertical" > //Red background <scrollview android:layout_width= "Match_parent" android: layout_height= "Match_parent" android:fillviewport= "true" android:background= "#ff00ff" > //Yellow background <android.support.v4.widget.swiperefreshlayout android:layout_width= "Match_parent" android: layout_height= "Fill_parent" android:background= "#ffff00" > //Black background <linearlayout Android:layout_width= "Match_parent" android:layout_height= "100DP" android:background= "#000000"/> </android.support.v4.widget.SwipeRefreshLayout> </ScrollView></LinearLayout>
>
The result is exactly what it looks like: we set up 100DP obviously didn't work.
It turns out that the child view is forced to set the height of the Swiperefreshlayout
Since this prompt to use swiperefreshlayout have this need: only the above part of the layout has a drop-down refresh effect, swiperefreshlayout height do not use wrap__content,
To specify a fixed height, a quilt layout fills the entire screen.
Height Measurement of Swiperefreshlayout