【问题标题】:ionic 3 -Keyboard pushes the whole screenionic 3 - 键盘推全屏
【发布时间】:2019-04-29 15:14:06
【问题描述】:

当键盘打开时,屏幕被推开,响应式设计就会出现问题

enter image description here enter image description here

<ion-content padding style="background: #B4838C; scroll-behavior: auto">
    <ion-grid style="height:100%;width:100% ; scroll-behavior: auto">
        <ion-row style="position:relative;top:5px; height:10%;max-height:10%;">
            <ion-col offset-1="" align-self-center="">
                <img src="../../assets/imgs/popUp.png" style="width: 10%" (click)="popNav()">
            </ion-col>
            <ion-col text-end="" align-self-center="">
                <button ion-button="" [full]="" class="btnStyle">
                    Change language
                </button>
            </ion-col>
</ion-row>
        <ion-row style="position:relative; height:50%;max-height: 60%; justify-content: center">
            <img src="../../assets/imgs/gr2.png" class="imgStyle">
        </ion-row>
        <ion-row style="position:relative; height:10%;max-height: 10%; background: #232648">
            <ion-col col-12="">
                <ion-item style="background: #232648">
                    <ion-input placeholder="Email" type="text"></ion-input>
                </ion-item>
            </ion-col>
        </ion-row>
        <ion-row style="position:relative; height:10%;max-height: 10%; background: #232648">
            <ion-col col-12="">
                <ion-item style="background: #232648">
                    <ion-input placeholder="Password" type="Password"></ion-input>
                </ion-item>
            </ion-col>
        </ion-row>
        <ion-row style="position:relative; height:10%;max-height: 10%; background: #232648">
            <ion-col col-12="">
                <ion-item style="background: #232648">
                    <ion-input placeholder="Full name" type="text"></ion-input>
                </ion-item>
            </ion-col>
        </ion-row>
        <ion-row style="position:relative; height:10%;max-height: 10%; background: #232648">
            <ion-col col-12="">
                <ion-item style="background: #232648">
                    <ion-input placeholder="Phone number" type="text"></ion-input>
                </ion-item>
            </ion-col>
        </ion-row>

        <ion-row style="position:relative; height:10%;max-height: 10%; background: #232648">
            <ion-col >
                <button  ion-button="" style="background: white;color: black; border-radius: 20px; width: 100%"> Sign In </button>
            </ion-col>
        </ion-row>
    </ion-grid>
</ion-content>

我构建了 ionic 3 应用程序。我有输入字段,当我按下它们开始输入屏幕更改的任何内容时..

【问题讨论】:

    标签: angular ionic-framework ionic3


    【解决方案1】:

    修改您的app.module.ts 文件,如下所示

     @NgModule({
        declarations: [
            MyApp,
            //...
        ],
        imports: [
            //...
            IonicModule.forRoot(MyApp, {
                scrollPadding: false,
                scrollAssist: true,
                autoFocusAssist: false
            })
        ],
        bootstrap: [IonicApp],
        entryComponents: [
            // ...
        ],
        providers: [
            // ...
        ]
    })
    export class AppModule { }
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2023-03-26
      • 2019-02-23
      • 1970-01-01
      • 2019-08-14
      • 1970-01-01
      • 1970-01-01
      • 2019-06-30
      • 1970-01-01
      相关资源
      最近更新 更多