Height Measurement of Swiperefreshlayout

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.