考虑下面的XML:在XML中设置的NativeScript zIndex无法正常工作?
<Page xmlns="http://schemas.nativescript.org/tns.xsd" >
<!-- UI Decalration -->
<AbsoluteLayout>
<GridLayout zIndex="99" height="100" width="100" backgroundColor="red"></GridLayout>
<GridLayout zIndex="1" height="200" width="200" backgroundColor="green"></GridLayout>
</AbsoluteLayout>
</Page>
在我的理解中的红色方块应该是可见的,但它的背后隐藏着绿色的。难道我做错了什么?
只需更改gridLayouts的顺序,然后最后一个元素将位于顶部。也许你可以在style/css中设置z-index? –
请注意,此时z-index仅在Android API级别21支持。 http://docs.nativescript.org/angular/ui/styling.html#supported-css-properties –