TextInputType.numberWithOptions不显示逗号或点 [英] TextInputType.numberWithOptions doesn't show comma or dot
问题描述
TextInputType.numberWithOptions(decimal: true),
我在我的TextFormField
中将上面的代码用作keyboardType
,但是在某些设备中,该设备不显示逗号或点.屏幕截图如下:
考虑使用此软件包: https://pub.dev/packages/virtual_keyboard >
有什么解决方法的想法吗?
这不能解决我的问题,因为就我而言,这是在Android上发生的. >带有数字键盘的Flutter TextField,逗号为而不是句号(仅限iOS)
在iOS上,即使是Flutter应用程序,也必须在ios构建设置中启用de(或en_US以外的任何其他语言环境)语言环境.
- 在Flutter项目中打开IOS文件夹
- 在IOS文件夹中,打开带有xCode的Runner.xcworkspace文件夹.
- 单击运行器,您将看到很多选项,单击信息,然后在本地化本机开发区域"下选择美国".
- 重建项目 此处为图片
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.
- Open the IOS folder in your flutter project
- Inside the IOS folder open Runner.xcworkspace folder with xCode.
- Click on the runner you will see bunch of option, click on info and under the Localization native development region select United States.
- Rebuild the project Here is the image attached
这篇关于TextInputType.numberWithOptions不显示逗号或点的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!