kivymd / KivyMD

KivyMD is a collection of Material Design compliant widgets for use with Kivy, a framework for cross-platform, touch-enabled graphical applications. https://youtube.com/c/KivyMD https://twitter.com/KivyMD https://habr.com/ru/users/kivymd https://stackoverflow.com/tags/kivymd
https://kivymd.readthedocs.io
MIT License
2.14k stars 655 forks source link

Invalidation of attributes when creating dynamic classes using kvlang in kivymd #1704

Open WangZhongDian opened 3 weeks ago

WangZhongDian commented 3 weeks ago
#:kivy 2.3.0
#:import NoTransition kivy.uix.screenmanager.NoTransition

<MiddleTopAppBar@MDTopAppBar>:

<MiddleTopAppBarTitle@MDTopAppBarTitle>:
    role:'small'
    type: 'small'
    pos_hint: {'center_x': 0.5}

<MiddleSM>:
    transition: NoTransition()
    MDScreen:
        name: 'taskpage'
        MDBoxLayout:
            orientation: 'vertical'
            MiddleTopAppBar:
                size_hint_y: 0.08
                MDTopAppBarLeadingButtonContainer:
                    MDActionTopAppBarButton:
                        icon: ''
                MiddleTopAppBarTitle:
                    text: '待办'
                    role:'small'
                MDTopAppBarTrailingButtonContainer:
                    MDActionTopAppBarButton:
                        icon: "plus"
                        on_release: root.add_team()
            ScrollView:
                pos_hint: {'center_x': 0.5, 'center_y': 0.5}
                do_scroll_x: False
                effect_cls: 'OpacityScrollEffect'
                MDGridLayout:
                    spacing: 2
                    id:scroll_grid_layout
                    cols: 1
                    adaptive_height: True

Many attributes such as role cannot take effect

HeaTTheatR commented 3 weeks ago

Clarify your question. It is not clear. Attach the minimum code.