久久久久久久av_日韩在线中文_看一级毛片视频_日本精品二区_成人深夜福利视频_武道仙尊动漫在线观看

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

    <bdo id='th3Ch'></bdo><ul id='th3Ch'></ul>
    1. <tfoot id='th3Ch'></tfoot>
        <i id='th3Ch'><tr id='th3Ch'><dt id='th3Ch'><q id='th3Ch'><span id='th3Ch'><b id='th3Ch'><form id='th3Ch'><ins id='th3Ch'></ins><ul id='th3Ch'></ul><sub id='th3Ch'></sub></form><legend id='th3Ch'></legend><bdo id='th3Ch'><pre id='th3Ch'><center id='th3Ch'></center></pre></bdo></b><th id='th3Ch'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='th3Ch'><tfoot id='th3Ch'></tfoot><dl id='th3Ch'><fieldset id='th3Ch'></fieldset></dl></div>
      1. <small id='th3Ch'></small><noframes id='th3Ch'>

        在 kivy 中,如何控制 TextInput 使用的 VKeyboard 的高

        In kivy, How can I control the height of the VKeyboard used by TextInput(在 kivy 中,如何控制 TextInput 使用的 VKeyboard 的高度)
        <tfoot id='CXYtM'></tfoot>
          <bdo id='CXYtM'></bdo><ul id='CXYtM'></ul>

              <tbody id='CXYtM'></tbody>

          • <legend id='CXYtM'><style id='CXYtM'><dir id='CXYtM'><q id='CXYtM'></q></dir></style></legend>

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

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

                  本文介紹了在 kivy 中,如何控制 TextInput 使用的 VKeyboard 的高度的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

                  問題描述

                  我有一個屏幕我想問一個問題,所以在 kv 語言中,我有

                  I have a Screen where I want to ask a question, so in the kv language, I have

                  Screen:
                          name: 'keyb'
                          BoxLayout:
                              orientation: 'vertical'
                              Label:
                                  id: rnl
                                  size_hint_y: .1
                                  text: ''
                              TextInput:
                                  id: tinput
                                  hint_text: '.mid'
                                  size_hint: (.8, .1)
                                  pos_hint: {'x': .1}
                                  multiline: False
                                  on_focus: root.focusCallback(args[1])
                              Widget:
                                  size_hint_y: .7
                  

                  當我想問問題時,我選擇屏幕并將焦點設置到 TextInput

                  When I want to ask the question, I select the screen and set the focus to the TextInput

                   self.tinput.text = ""
                   self.screens.current = 'keyb'
                   Clock.schedule_once(self.focusKbd, .1)
                  

                  然后通過此代碼級聯:

                  def focusKbd(self, x):
                      self.tinput.focus = True
                  def focusCallback(self, f):
                      if not f:
                          # Deal with input now
                          self.screens.current = 'seq'
                  

                  在這段代碼的某個地方,我想

                  Somewhere in this code, I would like to

                  1. 選擇 TextInput 將要彈出的 VKeyboard 布局(在我的代碼的其他部分會有所不同)
                  2. 調整 VKeyboard 的高度.

                  我不明白文本輸入中的 VKeyboard 來自哪里;有什么方法可以從 TextInput 中獲取對它的引用嗎?

                  I don't understand where the VKeyboard comes from in Text Input; is there some way I can get a reference to it from the TextInput?

                  這是對 https://stackoverflow 的重述.com/questions/36414654/how-can-i-change-the-size-of-kivys-vkeyboard 那里有提示,但還不足以讓我繼續前進!

                  This is a restatement of https://stackoverflow.com/questions/36414654/how-can-i-change-the-size-of-kivys-vkeyboard There is a hint there, but not enough to get me going!

                  ***********************************************

                  ********************* **************************

                  為了理解 Tshirtman 的回答,我把它放在我的主要小部件的頂部:

                  Trying to understand the answer from Tshirtman, I put this at the top of my main widget:

                  Window.set_vkeyboard_class(get_vkeyboard())
                  

                  然后添加

                  def get_vkeyboard():
                      print '>>>>>>>>>>>>>>>>>>>>>>>>>>in get_vkeyboard'
                      return VKeyboard
                  

                  我發現 get_vkeyboard() 被立即調用,早在我需要鍵盤之前.所以似乎我無法在 get_vkeyboard() 中動態控制 VKeyboard 的外觀.如果我感到困惑(我無疑是!),請糾正我.

                  I found that get_vkeyboard() was called immediately, long before I needed a keyboard. So it seems that I'm not going to be able to control anything about the appearance of the VKeyboard dynamically in get_vkeyboard(). Please correct me if I'm confused (which I undoubtedly am!).

                  還有其他方法可以動態修改 VKeyboard 的外觀嗎?

                  Is there some other way to modify the appearance of the VKeyboard dynamically?

                  附:Focus Behavior 中似乎有提示:

                  P.S. There seems to be a hint in Focus Behavior:

                  input_type 是一個 OptionsProperty,默認為text".可以是其中之一文本"、號碼"、網址"、郵件"、日期時間"、電話"或地址".

                  input_type is an OptionsProperty and defaults to ‘text’. Can be one of ‘text’, ‘number’, ‘url’, ‘mail’, ‘datetime’, ‘tel’ or ‘address’.

                  我在 .kv 中的 TextInput 中添加了input_type: 'number'",但沒有任何影響.

                  I added "input_type: 'number'" to a TextInput in .kv, but it didn't have any affect.

                  推薦答案

                  你可以使用 Window.set_vkeyboard_class 設置鍵盤類,但是沒有什么能阻止你注冊任何返回鍵盤實例的函數,所以您可以使用上下文(您的應用程序的狀態)來動態決定將使用哪個類.由于在這種情況下您要自己返回一個實例,因此您可以決定它的大小、位置和其他詳細信息.我在一些應用程序中使用了這種技術,以便在實例上使用 Animation 以將其平滑地放置在屏幕的特定位置.

                  You can set keyboard class using Window.set_vkeyboard_class, but nothing prevents you from registering any function that returns a keyboard instance there, so you could use the context (your app's state) to decide which class will be used, dynamically. Since you are returning an instance yourself in this case, you can decide of its size, pos, and other details. I used this technique in a few app to use Animation on the instance to place it in a particular spot of the screen smoothly.

                  偽例子:

                  from kivy.core.window import Window
                  from kivy.uix.vkeyboard import VKeyboard
                  from kivy.animation import Animation
                  from kivy.uix.screenmanager import ScreenManager, Screen
                  
                  class KeyboardA(VKeyboard):
                      def place(self):
                          self.center_x = Window.center_x
                          self.top = 0
                          Animation(y=100, t='out_elastic', d=.4).start(self)
                  
                  class KeyboardB(VKeyboard):
                       def place(self):
                          self.opacity = 0
                          Animation(opacity=1).start(self)
                  
                  class MyApp(App):
                       def build(self):
                           sm = ScreenManger()
                           sm.add_widget(Screen(name='a'))
                           sm.add_widget(Screen(name='b'))
                           return sm
                  
                       def get_keyboard(self, **kwargs):
                           if self.root.current == 'a':
                               kb = KeyboardA(**kwargs)
                  
                           else:
                               kb = KeyboardB(**kwargs)
                  
                           kb.place()
                           return kb
                  
                  Window.set_vkeyboard_class(app.get_keyboard)
                  

                  未經測試,但你應該明白.

                  untested, but you should get the idea.

                  這篇關于在 kivy 中,如何控制 TextInput 使用的 VKeyboard 的高度的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!

                  【網站聲明】本站部分內容來源于互聯網,旨在幫助大家更快的解決問題,如果有圖片或者內容侵犯了您的權益,請聯系我們刪除處理,感謝您的支持!

                  相關文檔推薦

                  How to make a discord bot that gives roles in Python?(如何制作一個在 Python 中提供角色的不和諧機器人?)
                  Discord bot isn#39;t responding to commands(Discord 機器人沒有響應命令)
                  Can you Get the quot;About mequot; feature on Discord bot#39;s? (Discord.py)(你能得到“關于我嗎?Discord 機器人的功能?(不和諧.py))
                  message.channel.id Discord PY(message.channel.id Discord PY)
                  How do I host my discord.py bot on heroku?(如何在 heroku 上托管我的 discord.py 機器人?)
                  discord.py - Automaticaly Change an Role Color(discord.py - 自動更改角色顏色)
                    <bdo id='HWQGW'></bdo><ul id='HWQGW'></ul>

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

                            <tbody id='HWQGW'></tbody>

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

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

                            主站蜘蛛池模板: 一区在线免费视频 | 日本不卡一区二区三区 | 日韩网站在线观看 | 亚洲欧美中文日韩在线v日本 | 午夜影院在线观看视频 | 久久久一区二区 | 国产高清av免费观看 | 91资源在线 | 欧美日韩黄 | 精品欧美激情精品一区 | 中文字幕一区在线观看视频 | 亚洲视频在线观看一区二区三区 | 日韩欧美视频在线 | sese视频在线观看 | 免费一区二区 | 久热精品在线播放 | 一区影院| 国产日韩欧美综合 | 精品福利一区二区三区 | 新91 | 国产在线观看福利 | 日日夜夜影院 | 色秀网站| 日韩精品一区二 | 色视频成人在线观看免 | 日韩中文字幕在线播放 | 99久久婷婷国产综合精品电影 | 久久久久国产一区二区三区 | 99免费精品| 国产97视频在线观看 | 欧美一区二区三区在线免费观看 | 国产999精品久久久 精品三级在线观看 | 国产三区av | 亚洲网站在线观看 | 犬夜叉在线观看 | 在线播放国产视频 | 伊人91在线 | 伊人网站 | 亚洲人成人一区二区在线观看 | 真人毛片 | 欧美亚洲免费 |