Skip to content

zIndex do not render correctly when declared in XML #2103

@NickIliev

Description

@NickIliev

When applied via *.css file z-index is working.
However when declared in *.xml file zIndex is renered by element position in the xml tree and not by its value.
Code to reproduce this issue :

<Page xmlns="http://schemas.nativescript.org/tns.xsd" >
  <!-- this won't work! -->
    <AbsoluteLayout>
      <GridLayout zIndex="99" height="100" width="100" backgroundColor="red"></GridLayout>
      <GridLayout zIndex="1" height="200" width="200" backgroundColor="green"></GridLayout>
    </AbsoluteLayout>
</Page>
<Page xmlns="http://schemas.nativescript.org/tns.xsd" >
  <!-- this works! -->
    <AbsoluteLayout>
      <GridLayout zIndex="1" height="200" width="200" backgroundColor="green"></GridLayout>
      <GridLayout zIndex="99" height="100" width="100" backgroundColor="red"></GridLayout>
    </AbsoluteLayout>
</Page>
// this works! 
.lower-grid {
    z-index: 1;
}
.upper-grid {
    z-index: 99;
}

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions