带有按钮的 Kivy 打开气泡

Kivy opening bubble with button

我希望能够通过单击按钮打开气泡。 我对基维有点陌生。 这是 kivy 文件中的代码:

  Button:
        bubble:bubble.__self__
        text:"Home"
        on_release:self.show_bubble
        Bubble:
            id:bubble       
            size_hint: (None, None)  
            size: (150, 50)        
            pos_hint: {'x': 1, 'y': 1.7}    
            arrow_pos: 'bottom_mid'        
            orientation: 'horizontal'       
            BubbleButton:            
                text: "This is"        
            BubbleButton:            
                text: "a"        
            BubbleButton:            
                text: "Bubble"  

有人能帮忙吗?

谢谢。

我曾在 KIVY 从事基于移动应用程序的开发工作。但是让我告诉你这很痛苦。如果您只想制作非基于移动设备的交互式 python 程序,我认为您应该从 Tkinter 模块开始。

KIVY真的很丑。我建议移植到 JAVA 进行移动应用程序开发,因为它天生就是这样做的。

要让每个人都开始使用 python 移动应用,我们还有很长的路要走。

您应该按照此处显示的示例进行操作: https://kivy.org/docs/api-kivy.uix.bubble.html

即将 Bubble 放在单独的 FloatLayout 中(例如),而不是在触发 Button