• <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?(安卓)

        时间:2023-05-28
          <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?(安卓)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  上一篇:带有芯片的 Android AutoCompleteTextView 下一篇:我们可以在edittext中有不可编辑的文本吗

                  相关文章

                  <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>
                    <tfoot id='poDCL'></tfoot>

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