【问题标题】:How to enable user input into android edittext in scientific notation如何以科学计数法启用用户输入到android edittext
【发布时间】:2015-11-11 19:12:22
【问题描述】:

我想要一个接受科学计数法数字的输入。如果您使用任何标准数字格式,科学记数法。例如

<EditText
   android:id="@+id/scientific_number" 
  android:inputType="number|numberSigned|numberDecimal" 
</EditText>

不起作用。用户不能输入科学计数法的指数部分(IE 1.00E-19)。

【问题讨论】:

    标签: android scientific-notation


    【解决方案1】:

    似乎没有内置方法可以显示带有额外“E”的数字键盘,这很令人困惑,因为它对许多应用程序都很有用。

    您有两种选择,一种是您可以按照此处所述设计自己的键盘:

    http://www.dreamincode.net/forums/index.php?automodule=blog&blogid=867&showentry=3460

    其次,您可以在编辑文本中放置一个“E”按钮(我更喜欢这种方法),或者将“E”放在光标处。此处描述了执行此操作的方法:

    How allow a specific character in Android numerical keyboard?

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2011-07-18
      • 1970-01-01
      • 1970-01-01
      • 2015-10-11
      • 1970-01-01
      相关资源
      最近更新 更多