• <small id='rhqlN'></small><noframes id='rhqlN'>

    <i id='rhqlN'><tr id='rhqlN'><dt id='rhqlN'><q id='rhqlN'><span id='rhqlN'><b id='rhqlN'><form id='rhqlN'><ins id='rhqlN'></ins><ul id='rhqlN'></ul><sub id='rhqlN'></sub></form><legend id='rhqlN'></legend><bdo id='rhqlN'><pre id='rhqlN'><center id='rhqlN'></center></pre></bdo></b><th id='rhqlN'></th></span></q></dt></tr></i><div id='rhqlN'><tfoot id='rhqlN'></tfoot><dl id='rhqlN'><fieldset id='rhqlN'></fieldset></dl></div>
    <legend id='rhqlN'><style id='rhqlN'><dir id='rhqlN'><q id='rhqlN'></q></dir></style></legend>

      1. <tfoot id='rhqlN'></tfoot>
          <bdo id='rhqlN'></bdo><ul id='rhqlN'></ul>
      2. 如何从 EditText 返回一个 int?(安卓)

        How do I return an int from EditText? (Android)(如何从 EditText 返回一个 int?(安卓))
          <tbody id='vesy2'></tbody>

      3. <legend id='vesy2'><style id='vesy2'><dir id='vesy2'><q id='vesy2'></q></dir></style></legend>

      4. <small id='vesy2'></small><noframes id='vesy2'>

      5. <tfoot id='vesy2'></tfoot>

              <bdo id='vesy2'></bdo><ul id='vesy2'></ul>

                  <i id='vesy2'><tr id='vesy2'><dt id='vesy2'><q id='vesy2'><span id='vesy2'><b id='vesy2'><form id='vesy2'><ins id='vesy2'></ins><ul id='vesy2'></ul><sub id='vesy2'></sub></form><legend id='vesy2'></legend><bdo id='vesy2'><pre id='vesy2'><center id='vesy2'></center></pre></bdo></b><th id='vesy2'></th></span></q></dt></tr></i><div id='vesy2'><tfoot id='vesy2'></tfoot><dl id='vesy2'><fieldset id='vesy2'></fieldset></dl></div>
                  本文介绍了如何从 EditText 返回一个 int?(安卓)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  基本上,我想要一个 Android 中的 EditText,我可以在其中输入一个整数值.也许有比 EditText 更合适的对象?

                  Basically, I want an EditText in Android where I can have an integer value entered into. Perhaps there is a more appropriate object than EditText for this?

                  推荐答案

                  现在,使用 EditText.使用 android:inputType="number" 将其强制为数字.将结果字符串转换为整数(例如,Integer.parseInt(myEditText.getText().toString())).

                  For now, use an EditText. Use android:inputType="number" to force it to be numeric. Convert the resulting string into an integer (e.g., Integer.parseInt(myEditText.getText().toString())).

                  将来,您可能会考虑使用 NumberPicker 小部件,一旦该小部件可用(预定在 Honeycomb 中).

                  In the future, you might consider a NumberPicker widget, once that becomes available (slated to be in Honeycomb).

                  这篇关于如何从 EditText 返回一个 int?(安卓)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  本站部分内容来源互联网,如果有图片或者内容侵犯了您的权益,请联系我们,我们会在确认后第一时间进行删除!

                  相关文档推荐

                  How to send data to COM PORT using JAVA?(如何使用 JAVA 向 COM PORT 发送数据?)
                  How to make a report page direction to change to quot;rtlquot;?(如何使报表页面方向更改为“rtl?)
                  Use cyrillic .properties file in eclipse project(在 Eclipse 项目中使用西里尔文 .properties 文件)
                  Is there any way to detect an RTL language in Java?(有没有办法在 Java 中检测 RTL 语言?)
                  How to load resource bundle messages from DB in Java?(如何在 Java 中从 DB 加载资源包消息?)
                  How do I change the default locale settings in Java to make them consistent?(如何更改 Java 中的默认语言环境设置以使其保持一致?)
                  <legend id='poDCL'><style id='poDCL'><dir id='poDCL'><q id='poDCL'></q></dir></style></legend>
                    <i id='poDCL'><tr id='poDCL'><dt id='poDCL'><q id='poDCL'><span id='poDCL'><b id='poDCL'><form id='poDCL'><ins id='poDCL'></ins><ul id='poDCL'></ul><sub id='poDCL'></sub></form><legend id='poDCL'></legend><bdo id='poDCL'><pre id='poDCL'><center id='poDCL'></center></pre></bdo></b><th id='poDCL'></th></span></q></dt></tr></i><div id='poDCL'><tfoot id='poDCL'></tfoot><dl id='poDCL'><fieldset id='poDCL'></fieldset></dl></div>

                      <bdo id='poDCL'></bdo><ul id='poDCL'></ul>
                        <tbody id='poDCL'></tbody>
                          <tfoot id='poDCL'></tfoot>

                          <small id='poDCL'></small><noframes id='poDCL'>