1. <small id='6tkqz'></small><noframes id='6tkqz'>

    2. <legend id='6tkqz'><style id='6tkqz'><dir id='6tkqz'><q id='6tkqz'></q></dir></style></legend>
      <tfoot id='6tkqz'></tfoot>

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

        • <bdo id='6tkqz'></bdo><ul id='6tkqz'></ul>

        使用 kivy textinput 的 'input_type' 属性的问题

        时间:2023-06-06

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

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

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

                    <tbody id='lWSQj'></tbody>

                  本文介绍了使用 kivy textinput 的 'input_type' 属性的问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  您好,我在使用 kivy 的 textinput 小部件的 input_type 属性时遇到问题.问题是我做了两个自定义文本输入,一个称为 StrText,我在其中设置 input_type = 'text'.然后是第二个名为 NumText 的文本输入,input_type = 'number'.我使用 kivy 启动器在我的手机上对此进行了测试,并注意到一旦我点击 NumText 输入,它会带来一个数字键盘,如果我点击 StrText,它会带来相同的数字键盘而不是普通的文本键盘.如果你稍微玩一下,你会发现大部分时间都会返回数字键盘.请问我的代码有问题吗,或者我该如何解决?你会在下面找到我的代码

                  Hi im having issues with using the input_type property of kivy's textinput widget. The thing is i made two custom text input one i called StrText where i set input_type = 'text'. Then a second text input named NumText with input_type = 'number'. I tested this on my phone using kivy launcher, and noticed that once i tap on the NumText input and it brings a number keyboard, if i tap on the StrText, it brings the same number keyboard instead of a normal text keyboard. If you play with it a little you'll notice mostly number key board is returned most of the time. Please is there something wrong with my code, or how can i fix this? You'll find my code below

                  main.py

                  from kivy.app import App
                  from kivy.uix.bubble import Bubble
                  from kivy.core.window import Window
                  
                  class  BubbleApp(App):
                      pass
                  
                  if __name__ == '__main__':
                      Window.fullscreen = False
                      BubbleApp().run()
                  

                  bubble.kv

                  GridLayout:
                      cols: 1
                      StrText:
                          height: '48dp'
                          size_hint_y: None
                  
                      Label:
                          text: 'Number keyboard below'
                          height: '48dp'
                          size_hint_y: None
                          multiline: False
                          font_size: self.height * .5
                  
                      NumText:
                          height: '48dp'
                          size_hint_y: None
                  
                  
                  <StrText@TextInput>:
                      input_type: 'text'
                      multiline: False
                      font_size: self.height * .5
                  
                  <NumText@TextInput>:
                      input_type: 'number'
                      input_filter: 'int'
                      multiline: False
                      font_size: self.height *.5
                  

                  推荐答案

                  最近我在使用 Kivy1.10.0 构建我的应用程序时遇到了类似的问题.我在 android 中使用了默认的键盘应用程序,但它仍然不断地从 Numeric Keypad 更改为 Text Keypad.

                  Recently I faced similar issue when I built my App using Kivy1.10.0. I used the default keyboard app in android but still it was keep changing from Numeric Keypad to Text Keypad.

                  这次我尝试使用 kivy==1.9.1 和 Cython==0.23.1 和 buildozer==0.32 来构建 .apk,它对我有用.

                  This time I tried kivy==1.9.1 with Cython==0.23.1 and buildozer==0.32 to build the .apk and it worked for me.

                  注意:

                  我建议创建一个 virtualenv 来安装上面的特定包并使用它来创建 .apk 文件.

                  I suggest to create a virtualenv to install above specific packages and use it to create the .apk file.

                  virtualenv build32env
                  source build32env/bin/activate
                  pip install buildozer==0.32 Cython==0.23.1
                  

                  执行 buildozer init 后,确保更改 buildozer.spec 文件:

                  After executing buildozer init make sure to change buildozer.spec file:

                  来自

                  requirements = kivy
                  

                  requirements = kivy==1.9.1
                  

                  否则它将使用最新的 kivy 版本来构建 .apk 文件.

                  otherwise it will use the latest kivy version to build the .apk file.

                  更多关于 buildozer 的细节

                  希望对他人有所帮助!

                  这篇关于使用 kivy textinput 的 'input_type' 属性的问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  上一篇:如何使用 Kivy 获取文本输入的值 下一篇:我怎样才能改变kivy窗口的位置

                  相关文章

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

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

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