Quantcast
Channel: Appcelerator Developer Center Q&A Unanswered Questions 20
Viewing all articles
Browse latest Browse all 8068

android blank web view

$
0
0

I am using Titanium Classic, 3.3.0.

I have a couple of web views in a tabbed based application which work well on iOS but on Android, it seems that the webview is blank until the user touches the screen (sometimes), so it is inconsistent. I have tried firing the click event (alos tried singletap, touchstart, touchend) on the window when the webview is loaded. This helped somewhat, but is still inconsistent and not a full working solution.

Some code:

var self = Ti.UI.createWindow({
    title:title,
    navBarHidden:true,
    fullscreen: true
});
 
var shopWebView=Ti.UI.createWebView({
    url:'http://test.com/?post_type=product',
    top:40,
    bottom:0,
    anchorPoint:1,
    softKeyboardOnFocus: Titanium.UI.Android.SOFT_KEYBOARD_HIDE_ON_FOCUS
});
 
shopWebView.setUserAgent("Android app webview");
 
shopWebView.addEventListener('beforeload', function(e){
    //alert("beforeload event");
    self.fireEvent('click');
    //self.fireEvent('singletap');
    //self.fireEvent('touchstart');
    //self.fireEvent('touchend');
    //self.fireEvent('focus');
    actInd.show();
});
 
shopWebView.addEventListener('load', function(e){
    //alert("load event");
    self.fireEvent('click');
    //self.fireEvent('singletap');
    //self.fireEvent('touchstart');
    //self.fireEvent('touchend');
    //self.fireEvent('focus');
    actInd.hide();
});
 
shopWebView.addEventListener('load', function onLoad(e){
    //shopWebView.reload();
    self.fireEvent('click');
    //self.fireEvent('singletap');
    //self.fireEvent('touchstart');
    //self.fireEvent('touchend');
    //shopWebView.removeEventListener('load', onLoad);
});
 
self.addEventListener('focus', function (e){
    self.fireEvent('click');
    //self.fireEvent('singletap');
    //self.fireEvent('touchstart');
    //self.fireEvent('touchend');
    //shopWebView.show();
    //alert('shop win focused');
});
The user needs to be able to navigate between pages in the webview which is a tab within my app. Any help appreciated.

Viewing all articles
Browse latest Browse all 8068

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>