mirror of
https://github.com/NativeScript/NativeScript.git
synced 2025-08-16 11:42:04 +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() {
|
||||
closeCallback("sample text");
|
||||
closeCallback("sample text\n");
|
||||
}
|
@ -1,4 +1,7 @@
|
||||
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;
|
||||
|
||||
@ -7,5 +10,19 @@ export function onShownModally(args: ShownModallyData) {
|
||||
}
|
||||
|
||||
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">
|
||||
<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" />
|
||||
</StackLayout>
|
||||
</Page>
|
@ -4,7 +4,7 @@ import { topmost } from "tns-core-modules/ui/frame";
|
||||
|
||||
export function btnClick(args: EventData) {
|
||||
(<Page>args.object).page.showModal("ui-tests-app/action-bar/modal-page", "", function (arg: string) {
|
||||
// ...
|
||||
console.log("Callback args: " + arg);
|
||||
}, true);
|
||||
}
|
||||
|
||||
|
@ -5,6 +5,7 @@ import { topmost } from "tns-core-modules/ui/frame";
|
||||
export function btnClick(args: EventData) {
|
||||
(<Page>args.object).page.showModal("ui-tests-app/action-bar/modal-page-hidden-action-bar", "", function (arg: string) {
|
||||
// ...
|
||||
console.log("Callback args: " + arg);
|
||||
}, true);
|
||||
}
|
||||
|
||||
|
@ -1,15 +1,15 @@
|
||||
<Page xmlns="http://schemas.nativescript.org/tns.xsd">
|
||||
<Page.actionBar>
|
||||
<ActionBar backgroundColor="green" title="Main View" icon="">
|
||||
<NavigationButton text="Back" icon="" tap="" />
|
||||
<ActionBar.actionItems>
|
||||
<ActionItem icon="" text="Left" tap="" ios.position="left" />
|
||||
<ActionItem icon="" text="Right" tap="" ios.position="right" />
|
||||
</ActionBar.actionItems>
|
||||
</ActionBar>
|
||||
</Page.actionBar>
|
||||
<StackLayout>
|
||||
<button text="Open Modal" tap="btnClick" />
|
||||
<button text="Go Back" tap="btnBack" />
|
||||
</StackLayout>
|
||||
<Page.actionBar>
|
||||
<ActionBar backgroundColor="green" title="Main View" icon="">
|
||||
<NavigationButton text="Back" icon="" tap="" />
|
||||
<ActionBar.actionItems>
|
||||
<ActionItem icon="" text="Left" tap="" ios.position="left" />
|
||||
<ActionItem icon="" text="Right" tap="" ios.position="right" />
|
||||
</ActionBar.actionItems>
|
||||
</ActionBar>
|
||||
</Page.actionBar>
|
||||
<StackLayout>
|
||||
<button text="Open Modal" tap="btnClick" />
|
||||
<button text="Go Back" tap="btnBack" />
|
||||
</StackLayout>
|
||||
</Page>
|
Reference in New Issue
Block a user