1

在这里,我正在尝试创建一个可以运行的应用程序,并且我希望使用相同的代码在 android 平板电脑中运行该应用程序。

但无法运行,因为他告诉我我的视图没有定义,但我不明白,因为它适用于 ipad 和 android 应该在逻辑上工作。

我的项目结构资源

 apps.js => (here I instanced, but views and it is here that I but which are not defined)

 pages

  base => (I have my views with all the contained)

 Helpers => ()

 pictures

 android => (or the images there)

因此,apps.js 会在“pages / base /”中看到,然后我几乎在 javascript 中看到过。

这是我在 apps.js 中的代码

Titanium.include("helpers/helpers.js")

//Default locale
opened_tab = true;
Titanium.include("i18n/fr.js");

var win = Titanium.UI.createWindow({
    backgroundColor:'#333',
    //orientationModes:Titanium.UI.LANDSCAPE_LEFT
});


if(Titanium.Platform.osname=="ipad")
    Titanium.UI.orientation = Titanium.UI.LANDSCAPE_LEFT;

if(Titanium.Platform.osname=="android")
    Titanium.UI.orientation = Titanium.UI.LANDSCAPE_LEFT;

var rotate = Ti.UI.create2DMatrix().rotate(90);
var counterRotate = rotate.rotate(-180);

var pages_references_ios = [
                                                {title:"Couverture",slug:"couverture"},
                                                {title:"Présentation concept",slug:"presentation"},
                                                {title:"Un monde de réussites",slug:"metiers_numeriques"},
                                                {title:"sign of success",slug:"sign_of_success"},
                                                {title:"1000 facons de devenir",slug:"1000_ways"},
                                                {title:"Pédagogie labos",slug:"labs"},
                                                {title:"Partenariats entreprise",slug:"enterprise"},
                                                {title:"la vie étudiante",slug:"student_life"},
                                                {title:"Campus map",slug:"map"},
                                                {title:"open campus",slug:"open_campus"},
                                                {title:"Chaine videos",slug:"video_channel"},
                                                {title:"Réseaux sociaux",slug:"social_networks"}
                                            ];
var pages_references_android = [
                                                {title:"Couverture",slug:"couverture"},
                                                {title:"Présentation concept",slug:"presentation"},
                                                {title:"Un monde de réussites",slug:"metiers_numeriques"},
                                                {title:"sign of success",slug:"sign_of_success"},
                                                {title:"1000 facons de devenir",slug:"1000_ways"},
                                                {title:"Pédagogie labos",slug:"labs"},
                                                {title:"Partenariats entreprise",slug:"enterprise"},
                                                {title:"Community awards",slug:"community"},
                                                {title:"la vie étudiante",slug:"student_life"},
                                                {title:"Campus map",slug:"map"},
                                                {title:"open campus",slug:"open_campus"},
                                                {title:"Chaine videos",slug:"video_channel"},
                                                {title:"Réseaux sociaux",slug:"social_networks"}
                                            ];

if(Titanium.Platform.osname=="ipad")
    pages_references = pages_references_ios;
else if(Titanium.Platform.osname=="android")
    pages_references = pages_references_android;

Ti.include("pages/topBar.js")

Ti.include("pages/bottomBar.js")


 var scrollView = Titanium.UI.createScrollableView({
    views:[cover, presentation_view,metiers_numeriques,
           sign_of_success_view,thousands_ways_view,
           labs_view,enterprise_view,student_life_view,
           map_view,open_campus_view,video_channel,social_view],
    maxZoomScale:1.0,
    currentPage:0,
    showPagingControl:false,
    cacheSize:5,
    zIndex:-100
});



if (Ti.Platform.name == 'android') {
    win.navBarHidden = true;
}

win.add(tabMenu);
//win.add(thumbnailsButtonView);

win.add(scrollView);
win.open();

对不起我的英语不好。谢谢你

4

0 回答 0