我有一个视图,它是XML文档中的另一个视图。下面是与顶级的观点:无法样式嵌套Alloy视图
windowBase.xml:
<Alloy>
<Window class="base">
<Window class="content">
<Label class="haveActivation" text="Have an activation code for this device?">
</Window>
<Require id="navigation1" class="navigation1" src="navigation" />
</Window>
</Alloy>
,这里是该视图的风格:
windowBase.tss:
".navigation1": {
top: 692,
left: 100,
height: 265
}
".content": {
backgroundColor: "white",
height: 692,
top: 0
}
".haveActivation": {
bottom: 10
}
这里是子导航视图:
navigation.xml:
<Alloy>
<View class="nav" id="nav" onClick="nav_click">
<Label class="tabExample" text="Tab here">
</View>
</Alloy>
而对于导航视图样式:
navigation.tss:
"#nav": {
zIndex: 9999,
backgroundImage: "Navigation-Background.png",
width: 1024,
height: 265
}
".tabExample": {
color: "white"
}
".container": {
backgroundColor: "white"
}
你可以看到我有必要的查看(.navigation1)顶部样式设置为692.然而,当它显示时,它会将视图呈现在屏幕中间而不是底部。我能够将它渲染到顶端的唯一方法是:692是,如果我将该样式放置在导航视图的#nav样式中,这似乎没有多大意义。 我在做什么错?