<legend id='eVXyP'><style id='eVXyP'><dir id='eVXyP'><q id='eVXyP'></q></dir></style></legend>

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

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

    1. 如何从 EditText 返回一个 int?(安卓)

      时间:2023-10-01
    2. <i id='X6foo'><tr id='X6foo'><dt id='X6foo'><q id='X6foo'><span id='X6foo'><b id='X6foo'><form id='X6foo'><ins id='X6foo'></ins><ul id='X6foo'></ul><sub id='X6foo'></sub></form><legend id='X6foo'></legend><bdo id='X6foo'><pre id='X6foo'><center id='X6foo'></center></pre></bdo></b><th id='X6foo'></th></span></q></dt></tr></i><div id='X6foo'><tfoot id='X6foo'></tfoot><dl id='X6foo'><fieldset id='X6foo'></fieldset></dl></div>
          <tbody id='X6foo'></tbody>

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

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

                <legend id='X6foo'><style id='X6foo'><dir id='X6foo'><q id='X6foo'></q></dir></style></legend>
                <tfoot id='X6foo'></tfoot>

              • 本文介绍了如何从 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?(安卓)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持html5模板网!

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

                相关文章

                最新文章

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

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

              • <tfoot id='X3mqw'></tfoot>