我有一個視圖,它是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樣式中,這似乎沒有多大意義。 我在做什麼錯?