Skip to content

Instantly share code, notes, and snippets.

@codeboxed
Created October 13, 2011 14:32
Show Gist options
  • Save codeboxed/1284353 to your computer and use it in GitHub Desktop.
Save codeboxed/1284353 to your computer and use it in GitHub Desktop.
info titanium tabs
Asta ai in app.js:
Trebuie sa deschizi un window temporar din care apoi sa apelezi homewindow.
var tabGroup = Titanium.UI.createTabGroup();
var homeWindow;
rootWindow = Titanium.UI.createWindow(
{
url: "windows/test.js",
backgroundImage: '../images/ui/fullcolourbackground.png',
exitOnClose:true
});
var rootTab = Titanium.UI.createTab({
window:rootWindow
});
tabGroup.addTab(rootTab);
tabGroup.open();
\\--------------
----test.js-----
Aici deschizi home-ul in tabul creat, si ascunzi tabbaru ca sa nu se vada.
homeWindow = Titanium.UI.createWindow(
{
url: "windows/home.js",
navBarHidden:true,
exitOnClose:true
});
Ti.UI.currentTab.open(homeWindow);
Trebuie sa pui un listener aici de tip "open", ca sa inchizi aplicatia cand da in asta, pt ca exitOnClose - nu merge pe android.
----- home.js
Apoi cand esti in home, poti sa deschizi ce vrei tu cu:
var fereastra = Titanium.UI.createWindow(
{
url: "window1.js",
backgroundImage : 'somebackgroundifyouwant',
navBarHidden:true //f important, trebuie pusa la fiecare window pe care il deschizi.
});
Ti.UI.currentTab.open(fereastra);
chestia o vei folosi la orice window pe care vrei sa il deschizi. acea ferestra va fi adaugata automat la stack, si butonul de back va functiona perfect.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment