我試圖顯示一個(gè)彈出窗口,以防今天是數(shù)據(jù)庫上的日期。問題是彈出窗口,但它似乎是在主屏幕后面構(gòu)建的。我認(rèn)為這是由于在“on_enter”方法上調(diào)用的,但無法解決此問題。請注意,此“設(shè)置”按鈕是從主屏幕而不是彈出窗口本身呈現(xiàn)的。這是我的 kv 文件:#:import Factory kivy.factory.Factory<ScreenManager>:<DiaDeRevisao@Popup>: title: 'Aten??o dia de revis?o' auto_dismiss: False size_hint:0.7,0.7 BoxLayout: canvas.before: Color: rgba:(1,1,1,1) Rectangle: size: self.size pos: self.pos BoxLayout: orientation:'vertical' MDLabel: text:'Hoje é dia de revis?o' Button: text: 'OK' on_press: root.dismiss()<FileChooserPop@Popup>: title:'Escolha o arquivo de audio MP3' BoxLayout: canvas.before: Color: rgba:(0,0,0,0.35) Rectangle: size: self.size pos: self.pos orientation: 'vertical' BoxLayout: size_hint_y: None height: sp(52) Button: text: 'Icon View' on_press: fc.view_mode = 'icon' Button: text: 'List View' on_press: fc.view_mode = 'list' FileChooser: id: fc FileChooserIconLayout FileChooserListLayout BoxLayout: size_hint_y: None MDTextButton: size_hint_x:0.4 text: 'Voltar' on_press: root.dismiss() MDIconButton: halign:'center' icon:'content-save' on_press:root.selected(fc.path, fc.selection) on_release: root.manager.current = 'Principal'<Main>: BoxLayout: orientation:"vertical" spacing:'50dp' padding:'70dp' BoxLayout: MDTextButton: text: 'Revis?es' on_press: root.manager.current = 'Revisoes'# on_release:Factory.FileChooserPop().open()這很奇怪,我無法弄清楚。我很感激任何幫助。干杯!
從“on_enter”內(nèi)部調(diào)用時(shí) Kivy 彈出窗口行為不當(dāng)
呼喚遠(yuǎn)方
2023-07-11 15:03:00