我已尝试遵循documentation来使用此小部件:
text_color_normal
和
text_color_active
,但它们不起作用。 :/
有人可以帮助我吗?’)
答案 0 :(得分:1)
我遇到了同样的问题,唯一的解决方案是使用ThemeManager。
main.py
from kivymd.app import MDApp
from kivy.uix.screenmanager import Screen, ScreenManager
from kivymd.uix.label import MDLabel
from kivymd.theming import ThemeManager
class Main(MDApp):
"""docstring for Main"""
def __init__(self):
super(Main, self).__init__()
self.screen = Screen()
self.sm = ScreenManager()
self.theme_cls = ThemeManager()
def build(self):
#Enter the desired color instead of red
self.theme_cls.primary_palette = "Red"
if __name__=='__main__':
Main().run()
main.kv
Screen:
ScreenManager:
id: screen_manager
Screen:
name: 'home_screen'
MDBottomNavigation:
panel_color: rgba('262626')
MDBottomNavigationItem:
icon: 'home'
text: 'home'