Titanium Community Questions & Answer Archive

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

How to show/hide Navigation bar and tool bar set

I would like to make slide show type app. When it shows the photo, it should have no navigation bar and tool bar set. Then it shows the set when it was tapped on the screen.

Please advise me.

— asked July 21st 2010 by kazuaki konno
  • navigationbar
  • slideshow
  • toolbar
2 Comments
  • Do you have the pictures in a scroll view?You could then have a scroll event listener that hides the toolbar and navbar

    — commented July 22nd 2010 by Robert Moore
  • to hide the toolbar try something like
    Ti.currentWindow.setToolbar(null,[animated;TRUE});

    — commented July 22nd 2010 by Robert Moore

3 Answers

  • I could make app to show/hide toolbar using createToolBar and visible setting below.

    // create button for show toolbar
    var showtoolbar = Titanium.UI.createButton({
    title:'show toolbar',
    width:200,
    height:40,
    top:80
    });

    // create toolbar
    var toolbar1 = Titanium.UI.createToolbar({
    items:[left,flexSpace, flexSpace,backbtn,flexSpace, flexSpace,right],
    bottom:0,
    borderTop:true,
    borderBottom:false,
    opacity:0.5,
    barColor:'#000',
    visible:false
    });
    win3.add(toolbar1);

    // create hidetoolbar
    var hidetoolbar = Titanium.UI.createButton({
    title:'Hide Toolbar',
    width:200,
    height:40,
    top:150
    });

    // event listener for hidetoolbar button
    hidetoolbar.addEventListener('click', function()
    {
    toolbar1.visible = false;
    });
    win3.add(hidetoolbar);

    var hidden=false;

    // event listener for showtoolbar button
    showtoolbar.addEventListener('click', function()
    {
    if (!hidden)
    {
    win3.hideNavBar();
    hidden = true;
    }
    else
    {
    win3.showNavBar();
    hidden = false;
    }

    toolbar1.visible = true;
    

    });
    win3.add(showtoolbar);
    win3.showNavBar();

    But I would like to use setToolbar(). How can I use it?
    Please advise me.

    — answered July 21st 2010 by kazuaki konno
    permalink
    0 Comments
  • After I created new window(w/o tab) and I tried Kitchen Sink source below from Window_toolbar.js.

    //
    // SINGLE BUTTON ON LEFT
    //
    var b1 = Titanium.UI.createButton({
    title:'One Button - Left',
    width:200,
    height:40,
    top:10
    });
    b1.addEventListener('click', function()
    {
    var b = Titanium.UI.createButton({
    title:'Button',
    style:Titanium.UI.iPhone.SystemButtonStyle.BORDERED,
    enabled:false
    });
    b.enabled = false;
    win.setToolbar([b]);
    });
    win.add(b1);

    But this did not show toolbar.
    Why does this happen?
    Do I need to have tab group like Kitchen Sink?

    So I have to use createToolBar. It showed toolbar. But I don't know how to disable this toolbar.
    How can I disable this toolbar?

    Please advise me.

    — answered July 21st 2010 by kazuaki konno
    permalink
    2 Comments
    • > to hide the toolbar try something like Ti.currentWindow.setToolbar(null,[animated;TRUE});

      — commented July 22nd 2010 by Robert Moore
    • Hi Robert,
      Thank you for the advise! It worked!.

      — commented July 23rd 2010 by kazuaki konno
  • to hide the toolbar try something like Ti.currentWindow.setToolbar(null,[animated;TRUE});

    — answered July 22nd 2010 by Robert Moore
    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.