【问题标题】:Flutter TextField Keyboard type does not work on iosFlutter TextField 键盘类型在 ios 上不起作用
【发布时间】:2020-11-22 09:32:35
【问题描述】:

Keyboard type 属性不会改变 ios 上键盘的外观。它在 android 上运行良好,在 ios 上也正常运行,直到它突然开始显示相同的键盘,而不管在文本字段上设置键盘类型属性。

这是文本字段:

TextFormField(
                  keyboardType: TextInputType.emailAddress,
                  initialValue: _loginValues['email'],
                  focusNode: _emailFocusNode,
                  textInputAction: TextInputAction.next,
                  onFieldSubmitted: (_) => FocusScope.of(context)
                      .requestFocus(_passwordFocusNode),
                  validator: (value) {
                    if (value.isEmpty) {
                      return 'Agrega un correo electronico por favor';
                    }
                    return null;
                  },
                  onSaved: (value) {
                    _loginValues['email'] = value;
                  },
                  cursorColor: Theme.of(context).accentColor,
                  
                ),

出现的键盘是这样的:Keyboard keyboard for email input

另外,无论我设置什么键盘属性,我都会得到相同的键盘

颤振医生的输出:

✓] Flutter (Channel master, 1.21.0-6.0.pre.141, on Mac OS X 10.15.5 19F101, locale en-US)
• Flutter version 1.21.0-6.0.pre.141 at /Users/santiagoracca/flutter
• Framework revision c748f1a7aa (21 hours ago), 2020-07-31 17:45:18 -0700
• Engine revision 280bbfc763
• Dart version 2.10.0 (build 2.10.0-2.0.dev bd528bfbd6)



[✓] Android toolchain - develop for Android devices (Android SDK version 28.0.3)
    • Android SDK at /Users/santiagoracca/Library/Android/sdk
    • Platform android-29, build-tools 28.0.3
    • Java binary at: /Applications/Android Studio.app/Contents/jre/jdk/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build 1.8.0_212-release-1586-b4-5784211)
    • All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS (Xcode 11.3.1)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Xcode 11.3.1, Build version 11C505
    • CocoaPods version 1.9.3

[✓] Chrome - develop for the web
    • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome

[✓] Android Studio (version 3.6)
    • Android Studio at /Applications/Android Studio.app/Contents
    • Flutter plugin version 45.1.1
    • Dart plugin version 192.7761
    • Java version OpenJDK Runtime Environment (build 1.8.0_212-release-1586-b4-5784211)

[✓] VS Code (version 1.47.3)
    • VS Code at /Applications/Visual Studio Code.app/Contents
    • Flutter extension version 3.13.1

[✓] Connected device (3 available)
    • iPhone (mobile)  • e0bc74dd38d4efaa541b9174cfb54bbd3044fce5 • ios            • iOS 12.4.7
    • Web Server (web) • web-server                               • web-javascript • Flutter Tools
    • Chrome (web)     • chrome                                   • web-javascript • Google Chrome 84.0.4147.105
**strong text**
• No issues found!

【问题讨论】:

    标签: ios flutter keyboard textfield


    【解决方案1】:

    我遇到了类似的问题,我可以通过切换到 Flutter 的稳定通道来解决它。

    flutter channel stable
    

    另外,请确保通过运行此命令将 Flutter 升级到最新版本

    flutter upgrade
    

    这些是您可以运行来解决问题的命令。让我知道它是否修复它。谢谢

    【讨论】:

    • 没问题,很高兴我能提供帮助
    猜你喜欢
    • 2021-09-06
    • 2022-01-08
    • 2021-04-07
    • 1970-01-01
    • 1970-01-01
    • 2020-04-29
    • 2020-05-11
    • 2019-03-08
    • 2021-10-06
    相关资源
    最近更新 更多