首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >为什么showModal在iOS中显示全屏?

为什么showModal在iOS中显示全屏?
EN

Stack Overflow用户
提问于 2016-12-28 05:37:22
回答 1查看 669关注 0票数 0

new.xml

代码语言:javascript
复制
<Page xmlns="http://www.nativescript.org/tns.xsd" 
  showingModally="onLoaded">
<StackLayout id="newUserModal" width="100%" height="auto" horizontalAlignment="center" verticalAlignment="center" backgroundColor="#F3F3F3" opacity="1">
    <StackLayout class="dialog-header">
        <label text="New User" />
    </StackLayout>
    <label class="header-line" />
    <StackLayout class="modal-row">
        <WrapLayout>
            <Label text="Name" class="modal-row-label" />
            <Label text="*" class="required-field" />
        </WrapLayout>
        <TextField id="user_Name" editable="true" text="" class="modal-row-textfield" />
    </StackLayout>
    <StackLayout class="modal-row">
        <WrapLayout>
            <Label text="Email" class="modal-row-label" />
            <Label text="*" class="required-field" />
        </WrapLayout>
        <TextField id="user_Email" editable="true" text="" class="modal-row-textfield" />
    </StackLayout>
    <StackLayout class="modal-row">
        <WrapLayout>
            <Label text="Username" class="modal-row-label" />
            <Label text="*" class="required-field" />
        </WrapLayout>
        <TextField id="user_userName" editable="true" text="" class="modal-row-textfield" />
    </StackLayout>
    <StackLayout class="modal-row">
        <WrapLayout>
            <Label text="Password" class="modal-row-label" />
            <Label text="*" class="required-field" />
        </WrapLayout>
        <TextField id="user_Password" editable="true" text="" secure="true" class="new-user-password" />
    </StackLayout>
    <GridLayout columns="*, 1, *" rows="auto">
        <label class="footer-button-cancel" text="Cancel" tap="dismiss" col="0" />
        <label class="footer-button-submit" text="Add" tap="submit" col="2"/>
    </GridLayout>
</StackLayout>
</Page>

JS

代码语言:javascript
复制
var NewUserModule = 'components/users/dialogs/new';

var context = {
    args: args
};

var fullscreen = false;

page.showModal(NewUserModule, context, function closeCallback(user_Name, user_Email, user_userName, user_Password, isChecked) {

    if (user_Name && user_Email && user_userName && user_Password) {
        updateList
            .addUser(user_Name, user_Email, user_userName, user_Password, isChecked)
            .catch(function (error) {
                // helpers.handleLoadError(error, 'Sorry, we could not add user');
            })
            .then(function () {
                loadUser();
            });
    }
}, fullscreen);

在上面的代码中,我在iOS中获得了全屏模式,而在android中只有页面大小。如何在iOS中将其修正为页面大小?

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2016-12-28 05:57:27

提示:通过在iPhone上的设计,一个模态页面只出现在全屏上。

参考资料:https://docs.nativescript.org/core-concepts/navigation#modal-pages

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/41355962

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档