Kivy:其他小部件无法与TreeVIew配合使用,小部件无法响应

时间:2020-05-03 17:36:18

标签: python treeview kivy

尝试制作带有树状视图和菜单的应用程序-动作栏,它们确实显示在图片中,但是您不能按它们,它们什么也没做。我尝试使用BoxLayout,GridLayout和FloatLayout进行任何更改,没有任何想法,如何解决呢?谢谢!

<CloudView>:
name: "cloud"
id: cloud_view
on_pre_enter: root.set_current_user()
tv: tv
actionmenu: actionmenu
my_layout: my_layout
GridLayout:
    id: my_layout
    rows: 3
    TreeView:
        id: tv
    Button:
        text: 'hhh'
        on_release: root.do_something()
    ActionBar:
        id: actionmenu
        pos_hint: {'top':1}
        ActionView:
            use_separator: True
            ActionPrevious:
                title: 'Action Bar'
                with_previous: False
                on_release: root.do_something()
            ActionOverflow:
            ActionButton:
                text: 'Btn0'
                on_release: root.do_something()
                icon: 'atlas://data/images/defaulttheme/audio-volume-high'
            ActionButton:
                text: 'Btn1'
                on_release: print('Btn1 Pressend')
            ActionButton:
                text: 'Btn2'
            ActionGroup:
                text: 'Group 1'
                ActionButton:
                    text: 'Btn3'
                ActionButton:
                    text: 'Btn4'
            ActionGroup:
                dropdown_width: 200
                text: 'Group 2'
                ActionButton:
                    text: 'Btn5'
                ActionButton:
                    text: 'Btn6'
                ActionButton:
                    text: 'Btn7'

how it looks like

1 个答案:

答案 0 :(得分:0)

ActionButton只是常规kivy Button的扩展,因此您必须按照documentation中所述分配on_releaseon_press动作。

相关问题