add safe area support to flexbox

This commit is contained in:
Martin Yankov
2018-08-29 16:10:32 +03:00
parent 52b1822df5
commit 9d9e4d350d
7 changed files with 56 additions and 26 deletions

View File

@@ -0,0 +1,10 @@
<Page xmlns="http://schemas.nativescript.org/tns.xsd"
xmlns:fragments="flexboxlayout/fragments">
<ActionBar>
<Label text="Action Bar"></Label>
</ActionBar>
<fragments:flexboxlayout-col-fragment></fragments:flexboxlayout-col-fragment>
</Page>

View File

@@ -8,10 +8,12 @@
<StackLayout>
<Label text="Pages w/ ActionBar"></Label>
<Button text="Flexbox Row" tap="onNavigate" route="flexboxlayout/action-bar/flexboxlayout-row-page"></Button>
<Button text="Flexbox Col" tap="onNavigate" route="flexboxlayout/action-bar/flexboxlayout-col-page"></Button>
</StackLayout>
<StackLayout>
<Label text="Pages w/o ActionBar"></Label>
<Button text="Flexbox Row" tap="onNavigate" route="flexboxlayout/no-action-bar/flexboxlayout-row-page"></Button>
<Button text="Flexbox Col" tap="onNavigate" route="flexboxlayout/no-action-bar/flexboxlayout-col-page"></Button>
</StackLayout>
</StackLayout>

View File

@@ -0,0 +1,11 @@
<FlexboxLayout flexDirection="column" class="flex">
<StackLayout backgroundColor="white">
<Label text="Lorem ipsum dolor sit amet, consectetur adipiscing elit. Duis euismod fermentum erat, eu vehicula nunc scelerisque quis. Aenean consequat elit sed lacus aliquam consequat."></Label>
</StackLayout>
<StackLayout flexGrow="1" backgroundColor="green">
<Label text="Lorem ipsum dolor sit amet, consectetur adipiscing elit. Duis euismod fermentum erat, eu vehicula nunc scelerisque quis. Aenean consequat elit sed lacus aliquam consequat."></Label>
</StackLayout>
<StackLayout backgroundColor="red">
<Label text="Lorem ipsum dolor sit amet, consectetur adipiscing elit. Duis euismod fermentum erat, eu vehicula nunc scelerisque quis. Aenean consequat elit sed lacus aliquam consequat."></Label>
</StackLayout>
</FlexboxLayout>

View File

@@ -1,11 +1,11 @@
<FlexboxLayout flexDirection="row" class="flex">
<StackLayout backgroundColor="white">
<Label text="Lorem"></Label>
</StackLayout>
<StackLayout flexGrow="1" backgroundColor="green">
<Label text="Lorem"></Label>
</StackLayout>
<StackLayout backgroundColor="red">
<Label backgroundColor="#965251" text="Item"></Label>
</StackLayout>
<StackLayout flexGrow="1" class="stack">
<Label flexGrow="1" backgroundColor="#d2b29b" text="Flex-Grow 1"></Label>
</StackLayout>
<StackLayout backgroundColor="blue">
<Label backgroundColor="#F69256" text="Item"></Label>
<Label text="Lorem"></Label>
</StackLayout>
</FlexboxLayout>

View File

@@ -0,0 +1,7 @@
<Page xmlns="http://schemas.nativescript.org/tns.xsd"
xmlns:fragments="flexboxlayout/fragments"
actionBarHidden="true">
<fragments:flexboxlayout-col-fragment></fragments:flexboxlayout-col-fragment>
</Page>

View File

@@ -1,4 +1,4 @@
<Page xmlns="http://schemas.nativescript.org/tns.xsd">
<Page xmlns="http://schemas.nativescript.org/tns.xsd" actionBarHidden="true">
<ActionBar>
<Label text="Home"></Label>
@@ -20,6 +20,7 @@
<Button text="Expand Examples" tap="onNavigate" route="expand/expand-page"></Button>
<Button text="Repeater Examples" tap="onNavigate" route="repeater/repeater-page"></Button>
<Button text="WebView Examples" tap="onNavigate" route="webview/webview-page"></Button>
<Button text="Flexbox Examples" tap="onNavigate" route="flexboxlayout/flexboxlayout-page"></Button>
</StackLayout>
</ScrollView>