第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號安全,請及時綁定郵箱和手機立即綁定
已解決430363個問題,去搜搜看,總會有你想問的

Kivy:使用“焦點”或“on_touch_down”清除文本輸入

Kivy:使用“焦點”或“on_touch_down”清除文本輸入

開心每一天1111 2021-08-05 10:39:59
我想清除TextInput的text:,當我點擊它。示例代碼:from kivy.app import Appfrom kivy.lang import Builderkv_string = """ScreenManager:    id: manager    Screen:        BoxLayout:            orientation: 'vertical'            Button:                text: 'Why does it clear multiple inputs? And why do they get cleared after touch_up?'            TextInput:                text: 'Write Your Name'                on_touch_down:                    self.text = ''            TextInput:                text: 'Write Your Last Name'                on_focus:                    self.text = ''            TextInput:                text: 'Write Your Phone Number'                on_touch_down:                    self.text = ''"""class MyApp(App):    def build(self):        root_widget = Builder.load_string(kv_string)        return root_widgetif __name__ == "__main__":    MyApp().run()無論是on_touch_down:或on_focus刪除只是目前專注文字輸入。相反,當我觸摸屏幕上的任何地方時,兩者都會被清除。一旦光標位于文本輸入上,我希望它們單獨清除。我也嘗試過,on_cursor但這也不起作用。我錯過了什么? 先感謝您!
查看完整描述

1 回答

  • 1 回答
  • 0 關注
  • 242 瀏覽
慕課專欄
更多

添加回答

舉報

0/150
提交
取消
微信客服

購課補貼
聯系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網APP
您的移動學習伙伴

公眾號

掃描二維碼
關注慕課網微信公眾號