这里我试图创建一个有效的应用程序,我想要相同的代码在Android平板电脑上运行该应用程序。
但不可能跑,因为他告诉我我的观点没有定义,但我不明白,因为它适用于ipad和android应该在逻辑上有效。
我的项目结构 ressouces
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)
所以在“pages / base /”中看到apps.js提取,然后我在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();
抱歉我的英语。
谢谢