1. <legend id='e26lG'><style id='e26lG'><dir id='e26lG'><q id='e26lG'></q></dir></style></legend>
      <tfoot id='e26lG'></tfoot>

      • <bdo id='e26lG'></bdo><ul id='e26lG'></ul>

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

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

        TextInput Kivy 的自动“焦点"

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

                <tbody id='mPXtQ'></tbody>
                • <bdo id='mPXtQ'></bdo><ul id='mPXtQ'></ul>
                  <legend id='mPXtQ'><style id='mPXtQ'><dir id='mPXtQ'><q id='mPXtQ'></q></dir></style></legend>

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

                  本文介绍了TextInput Kivy 的自动“焦点"的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

                  问题描述

                  我有一个如下所示的文本输入小部件:

                  I have a textinput widget that looks like this:

                  <ReaderWidget>:
                      Label:
                          text: 'Please scan EBT card'
                          font_size: root.height/8
                          size: self.texture_size
                          bold: True
                          color: 0, 0.70, 0.93, 1
                      TextInput:
                          focus: True
                          password: True
                          multiline: False
                          cursor: 0, 0
                  

                  根据用户按下另一个小部件中的按钮,小部件会动态添加到布局中.目前,用户必须在输入文本之前将鼠标/手指指向文本框,并且我希望光标在文本框中准备好接收文本,而无需用户通过鼠标按下来指示.有没有办法做到这一点?

                  The widget is dynamically added to the layout based on the user pressing a button in another widget. Currently the user has to point the mouse/finger into the text box before entering text, and I want the cursor to be in the text box ready to receive text without the user having to indicate by mouse press. Is there a way to do this?

                  似乎 focus : True 应该这样做.但它似乎没有.

                  It seems like focus : True should do it. But it doesn't seem to.

                  推荐答案

                  我知道这很旧,但是当我尝试做一些非常相似的事情时,我发现了这个问题.我用于添加 TextInput(并设置其焦点)的代码位于按钮的 on_press 处理程序中.按下会导致 TextInput 被添加到布局中并设置焦点,但是当按钮被释放时它会失去焦点.将我的代码移动到 on_release 解决了这个问题.

                  I know this is old but I found this question when I was trying to do something very similar. My code for adding the TextInput (and setting it's focus) was in the on_press handler for a button. A press would cause the TextInput to be added to the layout and it's focus set, but then it would lose focus when the button was released. Moving my code to on_release fixed the problem.

                  这篇关于TextInput Kivy 的自动“焦点"的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持html5模板网!

                  上一篇:如何从 kivy 小部件画布中删除特定说明? 下一篇:将功能绑定到 Kivy 按钮

                  相关文章

                  最新文章

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

                      • <bdo id='avm1j'></bdo><ul id='avm1j'></ul>
                    1. <small id='avm1j'></small><noframes id='avm1j'>