ScrollView start position is not at the top of the

Source: Internet
Author: User

ScrollView page layout has the upper and lower three layouts above, the bottom is a viewpager, run up Viewpager The default page page fills the entire screen, that is, ScrollView default starting position is not the top of the case, Finally, the problem was found because scrollview internal nesting problem, only need to set Viewpager get focus to false.

Method One:

In the Onresume () method, set the

Viewpager.setfocusable (FALSE);

Scrollview.setfocusable (TRUE);

Scrollview.setfocusableintouchmode (TRUE);

Scrollview.requestfocus ();

If the internal nesting is listview,gridview, it is the same way of handling.

Method Two:

Set Scrollview.smoothscrollto (0,20);

ScrollView start position is not at the top of the

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.