2016-12-28 44 views
0

new.xml爲什麼showModal在iOS中顯示全屏?

<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

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中的頁面大小?

回答