mirror of
https://github.com/NativeScript/NativeScript.git
synced 2025-11-05 13:26:48 +08:00
test(safe-area): add wrap layout examples
This commit is contained in:
committed by
Martin Yankov
parent
726c5bb913
commit
a9e37012bc
@@ -8,5 +8,6 @@
|
|||||||
<Button text="GridLayout Examples" tap="onNavigate" route="gridlayout/gridlayout-page"></Button>
|
<Button text="GridLayout Examples" tap="onNavigate" route="gridlayout/gridlayout-page"></Button>
|
||||||
<Button text="ScrollView Examples" tap="onNavigate" route="scrollview/scrollview-page"></Button>
|
<Button text="ScrollView Examples" tap="onNavigate" route="scrollview/scrollview-page"></Button>
|
||||||
<Button text="Component Examples" tap="onNavigate" route="component/component-page"></Button>
|
<Button text="Component Examples" tap="onNavigate" route="component/component-page"></Button>
|
||||||
|
<Button text="WrapLayout Examples" tap="onNavigate" route="wraplayout/wraplayout-page"></Button>
|
||||||
</StackLayout>
|
</StackLayout>
|
||||||
</Page>
|
</Page>
|
||||||
|
|||||||
10
e2e/safe-area/app/wraplayout/action-bar/wraplayout-page.xml
Normal file
10
e2e/safe-area/app/wraplayout/action-bar/wraplayout-page.xml
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
<Page xmlns="http://schemas.nativescript.org/tns.xsd"
|
||||||
|
xmlns:fragments="wraplayout/fragments">
|
||||||
|
|
||||||
|
<ActionBar>
|
||||||
|
<Label text="Action Bar"></Label>
|
||||||
|
</ActionBar>
|
||||||
|
|
||||||
|
<fragments:hwrap-fragment></fragments:hwrap-fragment>
|
||||||
|
|
||||||
|
</Page>
|
||||||
@@ -0,0 +1,6 @@
|
|||||||
|
<WrapLayout orientation="horizontal" backgroundColor="LightGreen">
|
||||||
|
<Label text="Lorem ipsum dolor sit amet Lorem ipsum dolor sit amet Lorem ipsum dolor sit amet Lorem ipsum dolor sit amet" height="100%" backgroundColor="LightPink"></Label>
|
||||||
|
<Label text="Lorem ipsum dolor sit amet Lorem ipsum dolor sit amet Lorem ipsum dolor sit amet Lorem ipsum dolor sit amet" backgroundColor="LightGray"></Label>
|
||||||
|
<!-- <Label text="Lorem ipsum dolor sit amet Lorem ipsum dolor sit amet Lorem ipsum dolor sit amet Lorem ipsum dolor sit amet" backgroundColor="LightYellow"></Label> -->
|
||||||
|
<!-- <Label text="Lorem ipsum dolor sit amet Lorem ipsum dolor sit amet Lorem ipsum dolor sit amet Lorem ipsum dolor sit amet" backgroundColor="LightCyan"></Label> -->
|
||||||
|
</WrapLayout>
|
||||||
@@ -0,0 +1,6 @@
|
|||||||
|
<Page xmlns="http://schemas.nativescript.org/tns.xsd"
|
||||||
|
xmlns:fragments="wraplayout/fragments" actionBarHidden="true">
|
||||||
|
|
||||||
|
<fragments:hwrap-fragment></fragments:hwrap-fragment>
|
||||||
|
|
||||||
|
</Page>
|
||||||
8
e2e/safe-area/app/wraplayout/wraplayout-page.ts
Normal file
8
e2e/safe-area/app/wraplayout/wraplayout-page.ts
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
import { View, EventData } from "tns-core-modules/ui/core/view/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/wraplayout/wraplayout-page.xml
Normal file
18
e2e/safe-area/app/wraplayout/wraplayout-page.xml
Normal file
@@ -0,0 +1,18 @@
|
|||||||
|
<Page xmlns="http://schemas.nativescript.org/tns.xsd">
|
||||||
|
|
||||||
|
<ActionBar>
|
||||||
|
<Label text="WrapLayout Examples"></Label>
|
||||||
|
</ActionBar>
|
||||||
|
|
||||||
|
<StackLayout horizontalAlignment="center">
|
||||||
|
<StackLayout>
|
||||||
|
<Label text="Pages w/ ActionBar"></Label>
|
||||||
|
<Button text="HWrap" tap="onNavigate" route="wraplayout/action-bar/wraplayout-page"></Button>
|
||||||
|
</StackLayout>
|
||||||
|
<StackLayout>
|
||||||
|
<Label text="Pages w/o ActionBar"></Label>
|
||||||
|
<Button text="HWrap" tap="onNavigate" route="wraplayout/no-action-bar/wraplayout-page"></Button>
|
||||||
|
</StackLayout>
|
||||||
|
</StackLayout>
|
||||||
|
|
||||||
|
</Page>
|
||||||
Reference in New Issue
Block a user