如何调整KivyMD手风琴的大小

时间:2018-09-17 14:02:11

标签: material-design kivy kivy-language

问题:

我正在使用KivyMD手风琴,它的高度占用了大部分UI空间并缩小了每个手风琴项中应包含的其他小部件,如下图所示。

如何固定/设置手风琴的高度以占用较小的空间?感谢任何输入!

代码段:

     MDAccordionItem:
        title: "HOME" 
        icon: 'key'
        GridLayout: # Root Layout of the screen
            rows:4

            ActionBar:
                pos_hint: {'top':1}
                ActionView:
                    use_separator: True
                    ActionPrevious:
                        title: 'Employee Info' 
                        with_previous: False

#-----------------CODE HERE FOR 2ND ACCORDION ITEM-------------------

enter image description here

1 个答案:

答案 0 :(得分:1)

MDAccordionSubItem:之前添加GridLayout:

摘要

 MDAccordionItem:
    title: "HOME" 
    icon: 'key'

    MDAccordionSubItem:
        GridLayout: # Root Layout of the screen
            rows:4

            ActionBar:
                pos_hint: {'top':1}
                ActionView:
                    use_separator: True
                    ActionPrevious:
                        title: 'Employee Info' #Nucleic Acid Extraction
                        with_previous: False

输出

Img01