【问题标题】:Problem with ion-input in the iOS platform ionic-3iOS平台ionic-3中的离子输入问题
【发布时间】:2018-11-14 05:23:57
【问题描述】:

我在 iOS 上遇到输入问题。在 Android 上,一切正常。进入应用程序后,我点击输入,出现键盘。然后,当我卸下键盘并再次单击输入时,屏幕的另一部分被按下。有人遇到过这样的问题吗?

我尝试了scrollAssist: falseautoFocusAssist: false,但没有帮助。

imports: [
    BrowserModule,
HttpClientModule,
    HttpModule,
    IonicStorageModule.forRoot({
        name: '__ForeverDB',
        driverOrder: ['indexeddb', 'sqlite', 'websql']
    }),
    IonicModule.forRoot(ForeverApp, {
  scrollAssist: false,
  autoFocusAssist: false,
  tabsHideOnSubPages: true,
        platforms: {
            ios: {
                backButtonText: 'Назад',
            }
        }
    }),
],

【问题讨论】:

  • 我也遇到了这个问题,首先我在 iOS 模拟器上尝试了我的应用程序,每次都有这个错误,但并不总是在物理设备上。我真的不知道为什么,但是降级到 ionic 3.8.x 为我解决了这个问题

标签: cordova ionic-framework ionic3


【解决方案1】:

iOS 12 上的键盘插件会出现此问题。

当键盘隐藏 HTML 文档没有恢复到原来的高度时,所有内容都可见但不能被“触摸”

试试这个:

app.component.ts 的构造函数内,每次键盘显示时,使用renderer2 将HTML 标记的高度设置为自动。

当键盘隐藏时,将高度设置为 101vh,这将使应用重新调整高度。

import {Renderer2} from '@angular/core';

//Get the HTML tag
let html = document.getElementsByTagName('html').item(0);

this.keyboard.onKeyboardHide().subscribe(() => {
    this.renderer2.setStyle(html, 'height','101vh')
});

this.keyboard.onKeyboardShow().subscribe(() => {
    this.renderer2.setStyle(html, 'height','auto')
});

【讨论】:

    猜你喜欢
    • 2017-12-19
    • 1970-01-01
    • 1970-01-01
    • 2019-11-18
    • 1970-01-01
    • 1970-01-01
    • 2019-08-16
    • 1970-01-01
    • 2019-09-01
    相关资源
    最近更新 更多