Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6960219
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T15:22:26+00:00 2026-05-27T15:22:26+00:00

I am trying to make a Demo in Appcelerator here is the code for

  • 0

I am trying to make a Demo in Appcelerator here is the code for it.

var tabGroup = Titanium.UI.createTabGroup();

var main_win = Titanium.UI.createWindow({  
     title:'Tab 1',
     backgroundColor:'#fff'
});

var win1 = Titanium.UI.createWindow({  
     title:'Tab 1',
     backgroundColor:'#fff'
});
var tab1 = Titanium.UI.createTab({ 
     title:'Tab 1',
     window:win1
});
var label1 = Titanium.UI.createLabel({
     text:'I am Window 1',
     win:win1
});
win1.add(label1);

var win2 = Titanium.UI.createWindow({  
     title:'Tab 2',
     backgroundColor:'#fff'
});
var tab2 = Titanium.UI.createTab({  
     title:'Tab 2',
     window:win2
});

var label2 = Titanium.UI.createLabel({
     text:'I am Window 2',
});
win2.add(label2);


tabGroup.addTab(tab1);  
tabGroup.addTab(tab2);  



main_win.open();

var button1 = Titanium.UI.createButton({
     title:"hello"
});
main_win.add(button1);
var button2 = Titanium.UI.createButton({
     title:"hello"
});
win1.add(button2);

button1.addEventListener('click', function(e) {
     tabGroup.open();
});

button2.addEventListener('click', function(e) {
     main_win.show();
     tabGroup.close();
});

Now button2 is not working in the desired way. I want to switch back to window_1 i.e the main window. What is going wrong with the code.

EDIT

I want to have a window (Can be a view/window or something else.) namely main_win which has a button named button1. When I click on button1 it moves to another view which shows me two tabbed views namely win1 and win2 associated with tab1 and tab2. Clicking on tab1 will show win1 and clicking on tab2 will show win2. Both win1 and win2 have a button say button2 clicking on which would send us back to the main_win. Also I want the transition to be like we are getting from scrollview by default.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T15:22:27+00:00Added an answer on May 27, 2026 at 3:22 pm

    I always just think about tabGroups as windows. It isn’t documented, but you can use the exitOnClose property on tabGroups in Android. Please see if the following code does what you need. Titanium SDK 1.7.5 targeting Android 2.2

    var main_win = Titanium.UI.createWindow({
        title : 'main_win',
        backgroundColor : '#fff'
    });
    var button1 = Titanium.UI.createButton({
        title : "open tabGroup",
        height:35,
        width:120
    });
    button1.addEventListener('click', function(e) {
        tabGroup.open();
    });
    main_win.add(button1);
    
    var win1 = Titanium.UI.createWindow({
        title : 'Tab 1',
        backgroundColor : '#fff'
    });
    var tab1 = Titanium.UI.createTab({
        title : 'Tab 1',
        window : win1
    });
    var label1 = Titanium.UI.createLabel({
        text : 'I am Window 1',
        win : win1
    });
    win1.add(label1);
    var button2 = Titanium.UI.createButton({
        title : "< back",
        top:5,
        left:5,
        height: 35,
        width: 80
    });
    win1.add(button2);
    button2.addEventListener('click', function(e) {
        tabGroup.close();
    });
    
    var win2 = Titanium.UI.createWindow({
        title : 'Tab 2',
        backgroundColor : '#fff'
    });
    var tab2 = Titanium.UI.createTab({
        title : 'Tab 2',
        window : win2
    });
    var label2 = Titanium.UI.createLabel({
        text : 'I am Window 2',
    });
    win2.add(label2);
    var button3 = Titanium.UI.createButton({
        title : "< back",
        top:5,
        left:5,
        height: 35,
        width: 80
    });
    win2.add(button3);
    button3.addEventListener('click', function(e) {
        tabGroup.close();
    });
    
    var tabGroup = Titanium.UI.createTabGroup({
        exitOnClose: false
    });
    tabGroup.addTab(tab1);
    tabGroup.addTab(tab2);
    
    main_win.open();
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to create a cmake equivalent to the following make: demo: main.cpp gcc
first question here, be nice :P I am trying to make an infinite UIScrollView
So basically what I'm trying to do is make something like this: http://store.kapit.biz/demo/treemap/prod/index.html# I've
Demo I am trying to make a snake game in html 5 canvas. But
Demo: http://jsfiddle.net/waitinforatrain/9JU5b/ I'm trying to make a notification icon thing that looks like this:
I am trying make long screen to vertical direction. So, I need a screen
Trying to make a make generic select control that I can dynamically add elements
Trying to make a MySQL-based application support MS SQL, I ran into the following
Trying to make a generic PL/SQL procedure to export data in specific XML format,
Trying to make a web service call to an HTTPS endpoint in my Silverlight

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.