mirror of
https://github.com/NativeScript/NativeScript.git
synced 2025-08-17 21:01:34 +08:00
Include test case for item 4151
This commit is contained in:
@ -7,5 +7,5 @@ export function onShownModally(args: ShownModallyData) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export function onTap() {
|
export function onTap() {
|
||||||
closeCallback("sample text");
|
closeCallback("sample text\n");
|
||||||
}
|
}
|
@ -1,4 +1,7 @@
|
|||||||
import { ShownModallyData } from "tns-core-modules/ui/page";
|
import { ShownModallyData } from "tns-core-modules/ui/page";
|
||||||
|
import { Button } from "tns-core-modules/ui/button";
|
||||||
|
import { Label } from "tns-core-modules/ui/label"
|
||||||
|
import { Page } from "tns-core-modules/ui/page"
|
||||||
|
|
||||||
let closeCallback: Function;
|
let closeCallback: Function;
|
||||||
|
|
||||||
@ -7,5 +10,19 @@ export function onShownModally(args: ShownModallyData) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export function onTap() {
|
export function onTap() {
|
||||||
closeCallback("sample text");
|
closeCallback("sample text\n");
|
||||||
|
}
|
||||||
|
|
||||||
|
export function change(args){
|
||||||
|
var button:Button =<Button>args.object;
|
||||||
|
|
||||||
|
var page:Page =<Page> button.parent;
|
||||||
|
|
||||||
|
console.log("---------------------page-------------------------")
|
||||||
|
console.log(page)
|
||||||
|
var label:Label = <Label> page.getViewById("label1");
|
||||||
|
label.text="fooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo";
|
||||||
|
|
||||||
|
var label2:Label = <Label> page.getViewById("label2");
|
||||||
|
label2.text="foooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo";
|
||||||
}
|
}
|
@ -1,5 +1,8 @@
|
|||||||
<Page showingModally="onShownModally">
|
<Page showingModally="onShownModally">
|
||||||
<StackLayout id="layout" >
|
<StackLayout id="layout" >
|
||||||
|
<Label backgroundColor="green" id="label1" text="short" textWrap="true" />
|
||||||
|
<Label backgroundColor="red" id="label2" text="" textWrap="true" />
|
||||||
|
<Button text="Change text" tap="change" />
|
||||||
<Button text="Close" tap="onTap" />
|
<Button text="Close" tap="onTap" />
|
||||||
</StackLayout>
|
</StackLayout>
|
||||||
</Page>
|
</Page>
|
@ -4,7 +4,7 @@ import { topmost } from "tns-core-modules/ui/frame";
|
|||||||
|
|
||||||
export function btnClick(args: EventData) {
|
export function btnClick(args: EventData) {
|
||||||
(<Page>args.object).page.showModal("ui-tests-app/action-bar/modal-page", "", function (arg: string) {
|
(<Page>args.object).page.showModal("ui-tests-app/action-bar/modal-page", "", function (arg: string) {
|
||||||
// ...
|
console.log("Callback args: " + arg);
|
||||||
}, true);
|
}, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -5,6 +5,7 @@ import { topmost } from "tns-core-modules/ui/frame";
|
|||||||
export function btnClick(args: EventData) {
|
export function btnClick(args: EventData) {
|
||||||
(<Page>args.object).page.showModal("ui-tests-app/action-bar/modal-page-hidden-action-bar", "", function (arg: string) {
|
(<Page>args.object).page.showModal("ui-tests-app/action-bar/modal-page-hidden-action-bar", "", function (arg: string) {
|
||||||
// ...
|
// ...
|
||||||
|
console.log("Callback args: " + arg);
|
||||||
}, true);
|
}, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,15 +1,15 @@
|
|||||||
<Page xmlns="http://schemas.nativescript.org/tns.xsd">
|
<Page xmlns="http://schemas.nativescript.org/tns.xsd">
|
||||||
<Page.actionBar>
|
<Page.actionBar>
|
||||||
<ActionBar backgroundColor="green" title="Main View" icon="">
|
<ActionBar backgroundColor="green" title="Main View" icon="">
|
||||||
<NavigationButton text="Back" icon="" tap="" />
|
<NavigationButton text="Back" icon="" tap="" />
|
||||||
<ActionBar.actionItems>
|
<ActionBar.actionItems>
|
||||||
<ActionItem icon="" text="Left" tap="" ios.position="left" />
|
<ActionItem icon="" text="Left" tap="" ios.position="left" />
|
||||||
<ActionItem icon="" text="Right" tap="" ios.position="right" />
|
<ActionItem icon="" text="Right" tap="" ios.position="right" />
|
||||||
</ActionBar.actionItems>
|
</ActionBar.actionItems>
|
||||||
</ActionBar>
|
</ActionBar>
|
||||||
</Page.actionBar>
|
</Page.actionBar>
|
||||||
<StackLayout>
|
<StackLayout>
|
||||||
<button text="Open Modal" tap="btnClick" />
|
<button text="Open Modal" tap="btnClick" />
|
||||||
<button text="Go Back" tap="btnBack" />
|
<button text="Go Back" tap="btnBack" />
|
||||||
</StackLayout>
|
</StackLayout>
|
||||||
</Page>
|
</Page>
|
Reference in New Issue
Block a user