繁体   English   中英

在 flutter android 中单击 TextFormField 时未显示键盘

[英]Keyboard is not showing on clicking on TextFormField in flutter android

我在 flutter 应用程序中使用 TextFormField。 在我的应用程序无处不在它工作正常,但只是在一个屏幕上它给了我一个错误。 当我单击 TextFormField 时,键盘打开并立即自动隐藏。 这是我的 TextFormField 代码。

TextFormField(
                      controller: offerController,
                      maxLines: 1,
                      keyboardType: TextInputType.number,
                      textInputAction: TextInputAction.next,
                      style: GoogleFonts.arimo(
                        textStyle: const TextStyle(
                          color: Color(ColorConstants.TEXT_COLOR_GREY),
                          fontSize: 14.0,
                          fontWeight: FontWeight.w400,
                        ),
                      ),
                      decoration: InputDecoration(
                        border: InputBorder.none,
                        enabledBorder: InputBorder.none,
                        hintText: "Add the Offer Value",
                        hintStyle: GoogleFonts.arimo(
                          textStyle: const TextStyle(
                            color:
                            Color(ColorConstants.COLOR_BFBFBF),
                            fontSize: 14.0,
                            fontWeight: FontWeight.w400,
                          ),
                        ),
                      ),
                    )

将此添加到您的 textFormField。

keyboardType: TextInputType.numberWithOptions(signed: true),
inputFormatters: [
  FilteringTextInputFormatter.digitsOnly,
],
onTap(){
   FocusNode.requestFocus();
}

在这种情况下,如果您使用 ios 仿真器,您可以看到此链接Flutter - Keyboard not displayed when TextFormField is selected

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM