繁体   English   中英

Appcelerator-Titanium项目无法在Android上运行

[英]Appcelerator-Titanium project wont run on Android

好的,所以我正在研究Appcelerator-Titanium的使用,并且正在研究这些教程。 从我学到的东西我试图运行这段代码。 它可以在iOS模拟器上完美运行,但不能在Android模拟器或Android手机(三星Galaxy 2s)上运行。 这是我尝试运行的代码。

<!-- 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();
        }
    })();

好吧,问题出在那一行: tGroup.add(tab1); 应该是: tGroup.addTab(tab1);

将标签添加到窗口而不是标签。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM