【发布时间】:2020-11-17 16:06:07
【问题描述】:
我已尝试关注此小部件的 documentation:
text_color_normal
和
text_color_active 但它们不起作用。 :/
有人可以帮我吗:')
【问题讨论】:
标签: python android ios user-interface kivy
我已尝试关注此小部件的 documentation:
text_color_normal
和
text_color_active 但它们不起作用。 :/
有人可以帮我吗:')
【问题讨论】:
标签: python android ios user-interface kivy
我遇到了同样的问题,唯一的解决方案是使用 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'
【讨论】:
您也可以导航到 kivymd/uix 然后打开底部导航。 py 并在第 273 行和第 289 行自定义 text_color 以将图标和标签设置为您想要的颜色,例如 1,1,1,1
【讨论】: