• <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 can I detect integer overflow on 32 bits int?(如何检测 32 位 int 上的整数溢出?)
                  Local variables before return statements, does it matter?(return 语句之前的局部变量,这有关系吗?)
                  How to convert Integer to int?(如何将整数转换为整数?)
                  How do I create an int array with randomly shuffled numbers in a given range(如何在给定范围内创建一个随机打乱数字的 int 数组)
                  Inconsistent behavior on java#39;s ==(java的行为不一致==)
                  Why is Java able to store 0xff000000 as an int?(为什么 Java 能够将 0xff000000 存储为 int?)
                  <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'>