feat: apply insets to flexbox row layout

This commit is contained in:
Vasil Chimev
2018-08-23 15:23:59 +03:00
committed by Martin Yankov
parent c02f062457
commit db7f913072
7 changed files with 69 additions and 3 deletions

View File

@@ -25,6 +25,10 @@ Page {
background-color: HoneyDew;
}
.flex {
background-color: Indigo;
}
.grid {
background-color: LightBlue;
}

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-row-fragment></fragments:flexboxlayout-row-fragment>
</Page>

View File

@@ -0,0 +1,8 @@
import { View, EventData } from "tns-core-modules/ui/core/view";
export function onNavigate(args: EventData) {
const view = args.object as View;
const route = view["route"];
view.page.frame.navigate(route);
}

View File

@@ -0,0 +1,18 @@
<Page xmlns="http://schemas.nativescript.org/tns.xsd">
<ActionBar>
<Label text="FlexboxLayout Examples"></Label>
</ActionBar>
<StackLayout horizontalAlignment="center">
<StackLayout>
<Label text="Pages w/ ActionBar"></Label>
<Button text="Flexbox Row" tap="onNavigate" route="flexboxlayout/action-bar/flexboxlayout-row-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>
</StackLayout>
</StackLayout>
</Page>

View File

@@ -0,0 +1,11 @@
<FlexboxLayout flexDirection="row" class="flex">
<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>
</StackLayout>
</FlexboxLayout>

View File

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