Titanium Community Questions & Answer Archive

We felt that 6+ years of knowledge should not die so this is the Titanium Community Questions & Answer Archive

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.

— asked April 5th 2010 by General Usage
  • mobile
  • navbar
  • tabbar
  • webview
0 Comments

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);

    — answered April 5th 2010 by Marcos Gonçalves
    permalink
    0 Comments
  • 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

    — answered April 6th 2010 by Marcos Gonçalves
    permalink
    0 Comments
  • 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.

    — answered April 5th 2010 by General Usage
    permalink
    0 Comments
  • OK so I have upgraded to 1.2 and tried

    Titanium.UI.currentTab.open(win);

    but that did not work. Any suggestions.

    — answered April 6th 2010 by General Usage
    permalink
    0 Comments
  • 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.

    — answered April 7th 2010 by General Usage
    permalink
    0 Comments
The ownership of individual contributions to this community generated content is retained by the authors of their contributions.
All trademarks remain the property of the respective owner.