TextInputType.numberWithOptions不显示逗号或点 [英] TextInputType.numberWithOptions doesn't show comma or dot

查看:701
本文介绍了TextInputType.numberWithOptions不显示逗号或点的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

TextInputType.numberWithOptions(decimal: true),

我在我的TextFormField中将上面的代码用作keyboardType,但是在某些设备中,该设备不显示逗号或点.屏幕截图如下:

考虑使用此软件包: https://pub.dev/packages/virtual_keyboard

有什么解决方法的想法吗?

这不能解决我的问题,因为就我而言,这是在Android上发生的. >带有数字键盘的Flutter TextField,逗号为而不是句号(仅限iOS)

解决方案

在iOS上,即使是Flutter应用程序,也必须在ios构建设置中启用de(或en_US以外的任何其他语言环境)语言环境.

  1. 在Flutter项目中打开IOS文件夹
  2. 在IOS文件夹中,打开带有xCode的Runner.xcworkspace文件夹.
  3. 单击运行器,您将看到很多选项,单击信息,然后在本地化本机开发区域"下选择美国".
  4. 重建项目 此处为图片

TextInputType.numberWithOptions(decimal: true),

I'm using the above code as a keyboardType in my TextFormField but in some devices, the device doesn't display comma or dot. Screenshot is given below:

Thinking of using this package: https://pub.dev/packages/virtual_keyboard

Any idea on how to solve it?

This doesn't solve my problem because in my case, it's happening on Android. Flutter TextField with number keyboard, comma is needed instead of period (Only iOS)

解决方案

On iOS you have to enable the de (or any other locale than en_US) locale in the ios build settings even for flutter apps.

  1. Open the IOS folder in your flutter project
  2. Inside the IOS folder open Runner.xcworkspace folder with xCode.
  3. Click on the runner you will see bunch of option, click on info and under the Localization native development region select United States.
  4. Rebuild the project Here is the image attached

这篇关于TextInputType.numberWithOptions不显示逗号或点的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆