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

MDButton's md_bg_color is not effective #1705

Closed WangZhongDian closed 3 weeks ago

WangZhongDian commented 3 weeks ago

version

kivymd=2.0.0 kivy=2.3

question

MDButton's md_bg_color is not effective

code

from kivy.lang import Builder

from kivymd.app import MDApp

KV = '''
MDScreen:
    MDButton:
        md_bg_color: "red"
        MDButtonIcon:
            icon: 'flag'
        MDButtonText:
            text: 'test'
'''

class Example(MDApp):
    def build(self):
        self.theme_cls.primary_palette = "Orange"
        return Builder.load_string(KV)

Example().run()

图片

No matter how you set the background color, it won't take effect

HeaTTheatR commented 3 weeks ago

theme_bg_color: "Custom"