Quantcast
Viewing all articles
Browse latest Browse all 8068

Navigation Bar without Tab Group

Hi Everyone. I'm restructuring an app I made a while ago to not have any tabs, but I'm having an issue. In the old version, when you'd click an image to go to another page, there'd be a button in the top left corner (in the Nav Bar) to go back to the previous page. Since getting rid of the tabs, the Nav Bar doesn't even appear, so I can't move backwards. I know I could make my own button, but I like the look of the Nav Bar.

Here's the code for the old app (with tabs and Nav Bar)

app.js

var tabGroup = Titanium.UI.createTabGroup();
 
 
 
var win1 = Titanium.UI.createWindow({
    url:'main_windows/allproducts.js',
    title:'All Products',
    backgroundColor:'#fff'
});
 
 
var tab1 = Titanium.UI.createTab({  
    icon:'KS_nav_allproducts.png',
    title:'All Products',
    window:win1
});
 
 
var label1 = Titanium.UI.createLabel({
    color:'#999',
    text:'All Products',
    font:{fontSize:20,fontFamily:'Helvetica Neue'},
    textAlign:'center',
    width:'auto'
});
 
win1.add(label1);

allproducts.js

var imageView2 = Titanium.UI.createImageView({
    image:'../images/Image.jpg',
    width:211,
    height:158,
    top:218,
    left:50
});
 
win.add(imageView2);
 
 
imageView2.addEventListener('click',function(e)
{
        var win = Titanium.UI.createWindow({
            url:'../products/P1.js',
            title:'Product1',
        });
        Titanium.UI.currentTab.open(win,{animated:true});
 
    });

And the new version (No tabs and no Nav Bar)

app.js

var win1 = Titanium.UI.createWindow({
    url:'allproducts.js' });
 
 
// open the window 
 
win1.open();
allproducts.js
var imageView = Titanium.UI.createImageView({
    image:'images/Image.png',
    top:50,
    left:30
});
 
win.add(imageView);
 
imageView.addEventListener('click',function(e)
{
    var win1 = Titanium.UI.createWindow({ 
    url:'P1.js',
    title:'Product1'
     });
 
    win1.open(win1,{animated:true});
});
I've tried changing a few things in the addEventListener, like adding navBarHidden:false; but that didn't make any difference.

Can anyone help me out?


Viewing all articles
Browse latest Browse all 8068

Trending Articles