thepoosh
thepoosh

Reputation: 12587

Appcelerator-Titanium project wont run on Android

ok, so I'm studying on the use of Appcelerator-Titanium and am going over the tutorials. from what i learned i tried to run this code. it runs perfectly fine on the iOS simulator but it wont run on Android emulator or an Android phone (Samsung Galaxy 2s). this is the code I've tried to run.

<!-- language: lang-js -->
    (function(){
        //creating a UI element for the application to run on
        app.UI = {};


        app.UI.createAppWindow = function(_args){
        //create the tab group to return from function
        var tGroup = Ti.UI.createTabGroup();
        //
        //creating the first window for the UI
        //
        var fWindow = Ti.UI.createWindow({
            title:'main window NUMBER 1',
            backgroundColor:'#fff'
        }) ;

        var tab1 = Ti.UI.createTab({
            icon:'KS_nav_ui.png',
            title:'main tab NUMBER 1',
            window:fWindow
        });

        var lbl1 = Ti.UI.createLabel({
            text:'this is my label this is my fun',
            color:'#999',
            font:{fontSize:20},
            textAlign:'center',
            width:'auto'
        });

        tab1.add(lbl1);

        tGroup.add(tab1);
        tGroup.open();
        }
    })();

Upvotes: 0

Views: 395

Answers (2)

The Zero
The Zero

Reputation: 1375

Add the label to the window instead of the tab.

Upvotes: 0

thepoosh
thepoosh

Reputation: 12587

well, the problem was in the line: tGroup.add(tab1); it's supposed to be: tGroup.addTab(tab1);

Upvotes: 1

Related Questions