Home > Web Front-end > HTML Tutorial > Solve the problem that the nested ListView or Gridview under ScrollView is not at the top of the page_html/css_WEB-ITnose

Solve the problem that the nested ListView or Gridview under ScrollView is not at the top of the page_html/css_WEB-ITnose

WBOY
Release: 2016-06-24 12:00:57
Original
1026 people have browsed it

Recent projects have used a scrollview with a ListView or Gridview nested inside it. Originally, this was not very good, but the interface does not provide web resources, so I had to piece it together one by one. I am a hard-working programmer, and everyone knows it. ,

But after writing it, I found a problem. Every time I enter this page, the scrollview is not displayed at the top, but at the bottom or in the middle. This makes me very sad. After searching Baidu and Google, I finally tried it. I have found a method that can solve this problem, but it is not a perfect solution and occasionally it will not work. The code is as follows:

scrollview.smoothScrollTo(0,0);


If you use it after drawing the data in the listview, you will not feel the page jump.

If you have a better method, I hope you can give me some advice.

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template