CreateWebView with Tab and NavBar
Hello Community,
I am trying to add a webview to the window stack instead of it being fullscreen. When I do the code below it comes up fullscreen. I want a back button to return to the previous screen as well as access to the navbar.
var b = Titanium.UI.createButton({title:'Google'});
-- set button on page --
b.addEventListener('click', function()
{
var win = Titanium.UI.createWindow({
fullscreen : false,
title:'Title'
});
var webview = Ti.UI.createWebView();
webview.url = 'http://www.google.com';
win.add(webview);
win.open();
}
What am I missing? Thanks for any help.
5 Answers
-
Accepted Answer
Hi,
You must not use win.open() because this will miss the navbar.
try to use Titanium.UI.currentTab.open(win);
-
General Usage
At the new SDK release (1.2) iphone has new API, the Navigation Group, maybe it'll be usefull for you
check this out: http://developer.appcelerator.com/apidoc/mobile/1.2/Titanium.UI.iPhone.NavigationGroup
-
Have you had that work with version 1.0. It did not work for me. I will upgrade when the new release comes out today. Then that might fix the problem. Thanks.
-
OK so I have upgraded to 1.2 and tried
Titanium.UI.currentTab.open(win);
but that did not work. Any suggestions.
-
Titanium.UI.currentTab.open(win); is correct. I had my code in the wrong file that is why it was not working. Thanks to all for your help.