[Android Pro] ScrollView using Fillviewport to set the height to matchparent

Source: Internet
Author: User

Tag: Blank picture cannot get file element tar pre ROI

Reference to:http://blog.csdn.net/u012975705/article/details/49275001

Before encountering a problem, that is, when using ScrollView, the layout of the ScrollView control can not fill the entire phone screen, by reading the source found, ScrollView has a Mfillviewport attribute:

set to true, the scroll view measure its child to make it fill the currently visible area

The idea is that when Mfillviewport is set to true, its child view is automatically filled with the entire area that is currently visible. That is, add the ScrollView control to the XML layout file

android:fillViewport="true"
能使ScrollView里的元素填满整个ScrollView。
 

[Android Pro] ScrollView using Fillviewport to set the height to matchparent

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.