Quantcast
Channel: Appcelerator Developer Center Q&A Unanswered Questions 20
Viewing all articles
Browse latest Browse all 8068

3 tab phone application not firing up.

$
0
0

I have a application im trying to create that has three tabs and is supposed to open up. I cant seem to figure out why it is not working and it's a fairly simple application.

function tabGroup() {
 
    Ti.UI.setBackgroundColor('#000');
 
 //creates tab group--------------------------------------------------------------------------------
var tabGroup = Ti.UI.createTabGroup();
// Tab 1--------------------------------Tab 1-------------------------------Tab1----------------------  
var win1 = Ti.UI.createWindow({  
       title:'Win 1',
       backgroundColor:'blue'
});
 
var label1 = Ti.UI.createImageView({
     image:"hkclogo.png",
     width:96,
     height:119
}); 
 
var tab1 = Ti.UI.createTab({
    window: win1,
    title: 'We are HKC',
    icon: 'newspaper.png',
});
// Tab 2--------------------------------Tab 2-------------------------------Tab 2--------------------
var tab2 = Ti.UI.createTab({
    window: win2,
    title: 'Shop',
    icon: 'crown.png'
});
 
var win2 = Ti.UI.createWindow({  
        title:'Win 2',
        backgroundColor:'pink'
});
 
var label2 = Ti.UI.createLabel({
     color: 'blue',
     text: 'I am Window 2',
     font:{fontSize:20,fontFamily:'Helvetica Neue'},
       textAlign:'center',
       width:'auto'
});
// Tab 3--------------------------------Tab3-------------------------------Tab3---------------------- 
var tab3 = Ti.UI.createTab({
    window: win3,
    title: 'join the mailing list',
    icon: 'email.png'
});
 
var win3 = Ti.UI.createWindow({  
    title:'Win 3',
    backgroundColor:'green'
});
 
var label3 = Ti.UI.createLabel({
     color: 'blue',
     text: 'I am Window 3...promise',
     font:{fontSize:20,fontFamily:'Helvetica Neue'},
     textAlign:'center',
     width:'auto'
});
 
 
 //adding elements for use--------------------------------------------------------------------------
tabGroup.addTab(tab1);
tabGroup.addTab(tab2);
tabGroup.addTab(tab3);
win1.add(label1);
win2.add(label2);
win3.add(label3);
 //opens tab group----------------------------------------------------------------------------------
    tabGroup.open();
 
 
 
return tabGroup;
 
};

Viewing all articles
Browse latest Browse all 8068

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>