【问题标题】:Cordova keyboard plugin issues with screen resizing and focusingCordova 键盘插件与屏幕大小调整和聚焦有关的问题
【发布时间】:2019-05-21 04:40:58
【问题描述】:

我正在使用 Meteor 和 Cordova 为 iOS 构建一个移动应用程序。单击输入字段以输入信息时,我无法正确配置屏幕。直到在键盘上输入内容后,屏幕才会聚焦在输入字段上,类似于此视频:https://github.com/cjpearson/cordova-plugin-keyboard/issues/62

但是,除了这个问题之外,在输入字段中单击会呈现约束 all out of whack。 (合上键盘让一切恢复正常)

目前我正在使用cordova-plugin-keyboard。我没有成功尝试过 cordova-plugin-ionic-keyboard 和 ionic-plugins-keyboard。除了我正在使用的插件,我还有这几行代码,按照this suggestion:

document.addEventListener('deviceready', function() {
      Keyboard.shrinkView(true)
      window.addEventListener('keyboardDidShow', function () {
        document.activeElement.scrollIntoView()
      })
    })

任何帮助都将不胜感激!这个问题困扰了我好久。

【问题讨论】:

    标签: ios cordova meteor cordova-plugins keyboard-events


    【解决方案1】:

    您可以尝试以下方法 - 这对我有用。

    运行mete或添加cordova:cordova-plugin-keyboard@1.2.0命令

    检查包含此 cordova-plugin-keyboard@1.2.0

    cordova-plugins

    Mobile-config

    中包含 App.setPreference('KeyboardShrinksView', true);

    运行流星重置

    运行 meteor 运行 ios-device --port 4000 --verbose

    检查包含此内容的 config.xml

    不要手动编辑 /.meteor/local/cordova-build/config.xml 文件, 因为它将在每次流星运行 ios/android 或流星时重新生成 构建,因此您将丢失所有修改。 https://riptutorial.com/meteor/example/16152/configure-your-cordova-project--config-xml- https://docs.meteor.com/api/mobile-config.html

    让我知道这是否也适用于您。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2015-08-21
      • 1970-01-01
      • 2017-07-25
      • 1970-01-01
      • 1970-01-01
      • 2018-09-25
      • 1970-01-01
      • 2012-12-18
      相关资源
      最近更新 更多