[AC-5072] Android: WebView with remote content scrolls extremely slowly
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | n/a |
Status | Closed |
Resolution | Needs more info |
Resolution Date | 2017-08-01T22:45:44.000+0000 |
Affected Version/s | n/a |
Fix Version/s | n/a |
Components | Titanium SDK & CLI |
Labels | android, performance, webview |
Reporter | Christopher.fox |
Assignee | Shak Hossain |
Created | 2017-07-05T15:52:28.000+0000 |
Updated | 2017-08-01T22:45:44.000+0000 |
Description
A webview containing remote content is extremely laggy. After a swipe gesture it takes literally seconds until the webview starts scrolling. The problem does not occur on devices with Android 4 or Android 5. Also not all Android 7 devices seem to be affected. We have successfully tested on another Android 7 device.
Tried to add borderRadius = 1, hardware acceleration and tested with and without caching. None of the options have any effect.
Code to test:
var webview = Ti.UI.createWebView(
{
left: 0,
top: '10%',
width '100%',
height: '90%',
backgroundColor: '#ffffff',
scalesPageToFit: false,
enableZoomControls: false,
hideLoadIndicator: false
});
webView.addEventListener('error', function(e)
{
// alert the error
});
webView.addEventListener('beforeload', function(e)
{
// show activity indicator
});
webView.addEventListener('load', function(e)
{
// hide activity indicator
});
webView.url = 'some_remote_url';
Hello, Make sure you follow the guide of best practice in http://docs.appcelerator.com/platform/latest/#!/guide/The_WebView_Component "Content displayed in a web view must be tuned for mobile browsers for best results. In particular, you should investigate the viewport meta tag options available for controlling the scaling, zooming, and size of the embedded content. For example, if a web view is resized, it may not dynamically re-layout its contents. Setting the viewport meta tag correctly can resolve these issues." Thanks.