私はTitaniumを初めて使用しますが、Androidで使用しようとすると、一見単純な2つの問題が発生します。
1)ボタンをクリックして次のページに移動しようとしています。代わりに、空白の黒い画面が表示されます。CreateNewMeetup.js
2番目のページをアプリのランディングページとして表示しようとしたところ、機能するので、2番目のページが正しいことがわかりました。私のコードは次のとおりです:-
ApplicationWindow.js
...
var button = Ti.UI.createButton({
height:44,
width:'auto',
title:'Create New Meetup',
top:20
});
self.add(button);
button.addEventListener('click', function() {
var newWindow = Ti.UI.createWindow({
url : "/ui/common/CreateNewMeetupWindow.js",
fullscreen: false
});
newWindow.open();
});
return self;
CreateNewMeetupWindow.js
//CreateNewMeetUpView Component Constructor
function CreateNewMeetupWindow() {
var self = Ti.UI.createWindow({
layout : 'vertical',
backgroundColor:'white'
});
var contactsField = Ti.UI.createTextField({
borderStyle : Ti.UI.INPUT_BORDERSTYLE_ROUNDED,
color : '#336699',
width : 400,
height : 60
});
self.add(contactsField);
var locationField = Ti.UI.createTextField({
borderStyle : Ti.UI.INPUT_BORDERSTYLE_ROUNDED,
color : '#336699',
width : 400,
height : 60
});
self.add(locationField);
var lblNotifyMe = Ti.UI.createLabel({
color : 'black',
text : 'Notify me when s/he is',
textAlign : Ti.UI.TEXT_ALIGNMENT_LEFT,
width : 'auto',
height : 'auto'
});
self.add(lblNotifyMe);
var btnGo = Ti.UI.createButton({
title : 'Go',
height : 'auto',
width : 100
});
btnGo.addEventListener('click', function() {
// Check console
Ti.API.info('User clicked the button ');
});
self.add(btnGo);
return self;
};
2)アプリをデバイスにインストールした後、起動しようとしました。アプリは一時的に表示され(おそらく約3秒)、その後自動的にシャットダウンします。私はそれがアプリのクラッシュだと思いますか?しかし、それはエミュレーターでうまく機能します。
チタンの専門家が助けてください:$