Open a webpage in a tab
I'm i missing something?
var webview = Titanium.UI.createWebView({url:'http:/www.apple.com/', scalesPageToFit:false});
var window = Titanium.UI.createWindow();
window.add(webview);
window.open();
This opens the page in fullscreen…
I want to maintain the top and bottom bar…
Tried using Titanium.UI.currentTab.open(window);
instead of window.open();
but it gives me a different top bar with a back button…
Any ideas…
Just need a simple webview inside a tab : )
2 Answers
-
Update…
I'm using the following code, but getting the error:
Can't find variable: win at 03.js (line 8).var w = Titanium.UI.currentWindow; w.orientationModes = [Titanium.UI.PORTRAIT]; var webview = Ti.UI.createWebView(); webview.url = 'http://www.apple.com'; webview.scalesPageToFit = false; w.add(webview); win.tab.open(w);
Also after openning the page how can i open links in a new window (showing a go back button)?
Thanks…
-
Try this. Just worked it out. This will open a webpage from a single tab and keep the tabs working (although I see you did post this a long time ago!). If not for you then for whoever may find this useful…
Cheers
John
var w = Ti.UI.currentWindow; w.orientationModes = [Titanium.UI.PORTRAIT]; var webview = Ti.UI.createWebView(); webview.url = 'http://sciencefictionworld.com'; webview.scalesPageToFit = false; w.add(webview);