mirror of
https://github.com/NativeScript/NativeScript.git
synced 2025-11-05 13:26:48 +08:00
feat: apply insets to flexbox row layout
This commit is contained in:
committed by
Martin Yankov
parent
c02f062457
commit
db7f913072
@@ -25,6 +25,10 @@ Page {
|
||||
background-color: HoneyDew;
|
||||
}
|
||||
|
||||
.flex {
|
||||
background-color: Indigo;
|
||||
}
|
||||
|
||||
.grid {
|
||||
background-color: LightBlue;
|
||||
}
|
||||
|
||||
@@ -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>
|
||||
8
e2e/safe-area/app/flexboxlayout/flexboxlayout-page.ts
Normal file
8
e2e/safe-area/app/flexboxlayout/flexboxlayout-page.ts
Normal 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);
|
||||
}
|
||||
18
e2e/safe-area/app/flexboxlayout/flexboxlayout-page.xml
Normal file
18
e2e/safe-area/app/flexboxlayout/flexboxlayout-page.xml
Normal 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>
|
||||
@@ -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>
|
||||
@@ -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>
|
||||
Reference in New Issue
Block a user