如何调整KivyMD手风琴的大小

问题描述 投票:0回答:1

问题:

我正在使用KivyMD Accordion,它的高度占据了大部分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

material-design kivy kivy-language
1个回答
1
投票

MDAccordionSubItem:之前添加GridLayout:

Snippet

 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

Output

Img01

© www.soinside.com 2019 - 2024. All rights reserved.