Titanium JIRA Archive
Appcelerator Community (AC)

[AC-5072] Android: WebView with remote content scrolls extremely slowly

GitHub Issuen/a
TypeBug
Priorityn/a
StatusClosed
ResolutionNeeds more info
Resolution Date2017-08-01T22:45:44.000+0000
Affected Version/sn/a
Fix Version/sn/a
ComponentsTitanium SDK & CLI
Labelsandroid, performance, webview
ReporterChristopher.fox
AssigneeShak Hossain
Created2017-07-05T15:52:28.000+0000
Updated2017-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';

Comments

  1. Sharif AbuDarda 2017-07-10

    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.

JSON Source