我有3個屏幕,合金(Appcelerator的):合金導航
INDEX.XML
<Alloy>
<Window class="container">
<ImageView id = "actor" image="/images/f_logo.jpg"></ImageView>
<Label id = "bienvenue" onClick="doClick" > Bienvenue </Label>
<Label id = "apropos"> A propos </Label>
</Window>
</Alloy>
的welcome.xml
<Alloy>
<Window class = "win2container">
<ImageView id = "bienvenue2" image="/images/f_logo.jpg"></ImageView>
<View id="texte" onClick="showTable">
<Label text="Afficher la liste" ></Label>
</View>
</Window>
</Alloy>
liste.xml
<Alloy>
<Tab title="Basic">
<Window title="Basic">
<ListView id = "liste" itemClick="onItemClick">
<ListSection>
<ListItem title="Row 1"></ListItem>
<ListItem title="Row 2"></ListItem>
<ListItem title="Row 3"></ListItem>
<ListItem title="Row 4"></ListItem>
<ListItem title="Row 5"></ListItem>
<ListItem title="Row 6"></ListItem>
<ListItem title="Row 7"></ListItem>
<ListItem title="Row 8"></ListItem>
<ListItem title="Row 9"></ListItem>
<ListItem title="Row 10"></ListItem>
<ListItem title="Row 11"></ListItem>
<ListItem title="Row 12"></ListItem>
</ListSection>
</ListView>
</Window>
</Tab>
</Alloy>
index.js(作品)
function doClick(e) {
var win = Alloy.createController("welcome").getView();
win.open();
}
$.index.open();
welcome.js(我想打開窗戶清單當然)
function showTable(e){
var liste = Alloy.createController("liste");
liste.getView().open();
}
當我的索引標識它打開歡迎窗口點擊當我點擊歡迎視圖時,它什麼也不做,我的目的是發現如何在合金中瀏覽多個窗口(查看文件)。
其次我對谷歌看到,這是一個很好的做法,關閉以前的Windows這樣的:它不
$.win.close();
$.win = null;
當我把這個代碼中index.js後$ .win.open()作品(即:我得到錯誤)
function doClick(e) {
var win = Alloy.createController("bienvenue").getView();
win.open();
$.win.close(); // or win.close() ?
$.win = null; // or win = null ?
}
有什麼建議嗎?我嘗試了很多次而沒有成功。
謝謝大家。
任何知名和經過測試的庫,可以爲我做跨平臺請嗎? – SudoPlz 2015-09-15 15:14:59