JohnC Expert Licensed User Longtime User Oct 29, 2019 #1 I am using Webview and adding the ChromeClient to it. I am noticing that vertical scrolling of pages are not very smooth as compared to opening the same page in a Chrome browser app on the same phone. Any ideas why?
I am using Webview and adding the ChromeClient to it. I am noticing that vertical scrolling of pages are not very smooth as compared to opening the same page in a Chrome browser app on the same phone. Any ideas why?
Erel B4X founder Staff member Licensed User Longtime User Oct 29, 2019 #2 Don't think that it will make any difference but it is worth testing: Code: Copy Dim jo As JavaObject = WebView1 jo.RunMethod("setLayerType", Array(2, Null)) 'LAYER_TYPE_HARDWARE Upvote 0
Don't think that it will make any difference but it is worth testing: Code: Copy Dim jo As JavaObject = WebView1 jo.RunMethod("setLayerType", Array(2, Null)) 'LAYER_TYPE_HARDWARE
JohnC Expert Licensed User Longtime User Oct 29, 2019 #3 I tried it but it doesn't seem to do anything. The problem is two-fold: 1) If I swipe up or down, sometimes the page will continue to scroll and "slowly" come to a stop, which is normal and desired. Other times, the page will *immediately* stop as soon as my finger lifts up from the screen after a swipe up/down - not the greatest UX that the user is accustomed to. 2) The other problem, which is MUCH worse, is that as I am swiping up/down, the view will start scrolling in the desired direction, but as soon as my finger lifts up from the screen, the screen will jump BACK to the original scroll position it was in before I even touched the screen! The client is complaining about this adverse scrolling response and I don't know what to do Last edited: Oct 31, 2019 Upvote 0
I tried it but it doesn't seem to do anything. The problem is two-fold: 1) If I swipe up or down, sometimes the page will continue to scroll and "slowly" come to a stop, which is normal and desired. Other times, the page will *immediately* stop as soon as my finger lifts up from the screen after a swipe up/down - not the greatest UX that the user is accustomed to. 2) The other problem, which is MUCH worse, is that as I am swiping up/down, the view will start scrolling in the desired direction, but as soon as my finger lifts up from the screen, the screen will jump BACK to the original scroll position it was in before I even touched the screen! The client is complaining about this adverse scrolling response and I don't know what to do
JohnC Expert Licensed User Longtime User Oct 29, 2019 #4 Since your suggestion mentioned "Hardware", for kicks and giggles I ENABLED hardware acceleration in the manifest (it was disabled): Code: Copy SetApplicationAttribute(android:hardwareAccelerated, "true") And at least on my device, the scrolling seems much better now. But, I remember older threads saying to keep hardware acceleration disabled when using webview because it can cause webpages to render blank pages. So, I don't know if that was just an issue with older android versions. So, I sent the client the new build with hardware acceleration enabled and keeping my fingers crossed... UPDATE: The client says the scrolling is much better Last edited: Oct 31, 2019 Upvote 0
Since your suggestion mentioned "Hardware", for kicks and giggles I ENABLED hardware acceleration in the manifest (it was disabled): Code: Copy SetApplicationAttribute(android:hardwareAccelerated, "true") And at least on my device, the scrolling seems much better now. But, I remember older threads saying to keep hardware acceleration disabled when using webview because it can cause webpages to render blank pages. So, I don't know if that was just an issue with older android versions. So, I sent the client the new build with hardware acceleration enabled and keeping my fingers crossed... UPDATE: The client says the scrolling is much better
FrostCodes Active Member Licensed User Longtime User Oct 31, 2019 #5 Hi did you try this out https://www.w3schools.com/howto/howto_css_smooth_scroll.asp#section2 Upvote 0
JohnC Expert Licensed User Longtime User Oct 31, 2019 #6 FrostCodes said: Hi did you try this out https://www.w3schools.com/howto/howto_css_smooth_scroll.asp#section2 Click to expand... Hi, thank you for replying. However, the problem is that sometimes the *same* page will scroll ok and sometimes not. So, it wasn't a "setting" in the page that was causing this problem. The solution I found that worked was enabling hardware acceleration - now the page scrolls smoothly. Last edited: Oct 31, 2019 Upvote 0
FrostCodes said: Hi did you try this out https://www.w3schools.com/howto/howto_css_smooth_scroll.asp#section2 Click to expand... Hi, thank you for replying. However, the problem is that sometimes the *same* page will scroll ok and sometimes not. So, it wasn't a "setting" in the page that was causing this problem. The solution I found that worked was enabling hardware acceleration - now the page scrolls smoothly.