mirror of
https://github.com/NativeScript/NativeScript.git
synced 2025-08-15 19:26:42 +08:00
feat(modal): introduce stretched param to showModal method (#5496)
* fix-next(ios-modal-view): force stretch alignment * feat(modal): introduce stretched param to showModal method * test(modal-view): add modal view stretched test
This commit is contained in:

committed by
Svetoslav

parent
6509efa430
commit
0138873ee3
@ -1,6 +1,5 @@
|
||||
<Page xmlns="http://schemas.nativescript.org/tns.xsd" shownModally="onShownModally"
|
||||
loaded="onLoaded" unloaded="onUnloaded" backgroundColor="Red"
|
||||
horizontalAlignment="center" verticalAlignment="middle">
|
||||
loaded="onLoaded" unloaded="onUnloaded" backgroundColor="Red">
|
||||
<StackLayout backgroundColor="PaleGreen" margin="10">
|
||||
<TextField hint="username" id="username" text="username"/>
|
||||
<TextField hint="password" id="password" text="password" secure="true"/>
|
||||
|
@ -10,3 +10,15 @@ export function onTap(args) {
|
||||
label.text = username + "/" + password;
|
||||
}, fullscreen);
|
||||
}
|
||||
|
||||
export function onTapStretched(args) {
|
||||
const page = <Page>args.object.page;
|
||||
const label = page.getViewById<Label>("label");
|
||||
var fullscreen = false;
|
||||
var stretched = true;
|
||||
|
||||
page.showModal("ui-tests-app/modal-view/login-page", "context", function (username: string, password: string) {
|
||||
console.log(username + "/" + password);
|
||||
label.text = username + "/" + password;
|
||||
}, fullscreen, false, stretched);
|
||||
}
|
||||
|
@ -2,6 +2,7 @@
|
||||
<StackLayout backgroundColor="PaleGreen">
|
||||
<Button text="Login (pop-up)" tap="onTap" />
|
||||
<Button text="Login (full-screen)" tap="onTap" />
|
||||
<Button text="Login (pop-up-stretched)" tap="onTapStretched" />
|
||||
<Label id="label" text="Anonymous"/>
|
||||
</StackLayout>
|
||||
</Page>
|
Reference in New Issue
Block a user