In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-09-21 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/02 Report--
This article is about how Android WebView determines whether to scroll to the bottom or not. The editor thinks it is very practical, so share it with you as a reference and follow the editor to have a look.
Scene:
Sometimes we need to play some must-read announcements, but we may not turn it off until you have finished reading it, so we need to scroll to the bottom to display the close button, and the announcements are often based on rich text, so we need to use WebView when displaying them on Android. Based on this requirement, we have to judge whether WebView scrolls to the bottom.
Analysis:
To determine whether or not to reach the bottom, let's first analyze which cases there are. There are two situations when the html document is loaded into WebView.
The html content in WebView is not filled, that is, there is no scroll bar. The height of the html content is higher than that of the WebView control, so there is a scroll bar, that is, a scroll bar
For case 1, if there is no scroll bar, we can just display the close button, but for the second case with scroll bar, we need to calculate the height, that is, html height = WebView height + scroll bar length, then we can judge that the scroll bar has reached the bottom.
Achieve:
Html height
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
The market share of Chrome browser on the desktop has exceeded 70%, and users are complaining about
The world's first 2nm mobile chip: Samsung Exynos 2600 is ready for mass production.According to a r
A US federal judge has ruled that Google can keep its Chrome browser, but it will be prohibited from
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
About us Contact us Product review car news thenatureplanet
More Form oMedia: AutoTimes. Bestcoffee. SL News. Jarebook. Coffee Hunters. Sundaily. Modezone. NNB. Coffee. Game News. FrontStreet. GGAMEN
© 2024 shulou.com SLNews company. All rights reserved.