【发布时间】:2014-03-16 00:25:13
【问题描述】:
不知道我在哪里做错了。我尝试通过代码和 xml,但由于某种原因,左侧导航按钮没有显示。我正在使用模拟器,因为我没有适用于 ios 的实际设备。
xml 视图
<!--filename: playType.xml->
<Alloy>
<Window class="container">
<LeftNavButton platform="ios">
<Button title="Back" onClick="closeWindow"/>
</LeftNavButton>
<View class="buttonContainer">
<Button class="menuButton" title="Single Player"/>
<Button class="menuButton" title ="Duel"/>
</View>
</Window>
</Alloy>
控制器
//playType.js
var args = arguments[0] || {};
var closeWindow = function(){
$.playType.close();
};
tss 风格
//playType.tss
".container" : {
backgroundColor:"white",
height:Ti.UI.FILL,
},
".buttonContainer":{
center:{x:"50%",y:"50%"},
height:Ti.UI.SIZE,
layout:"vertical"
}
我在 index.js 中使用这个
var playType = Alloy.createController('playType').getView();
playType.open();
窗口显示正常,中间有两个按钮,但没有出现后退按钮。 我究竟做错了什么。我浏览了文档,也尝试了代码方式。结果相同,没有后退按钮。 :(
【问题讨论】: