[Python] I try to change the background color of topappbar

Discussão em 'Python' iniciado por Stack, Dezembro 17, 2024.

  1. Stack

    Stack Membro Participativo

    I am new to kivymd, using version 2.0.1dev0 and I want to apply TopAppBar but when I try to change the background color it just doesn't work and only shows white color. This is my code

    enter image description here : MDScreen: MDNavigationLayout: MDScreenManager: MDScreen: name: "main_screen"

    MDTopAppBar:
    type: "small"
    md_bg_color: 0.2,0.4,0.8,1

    MDTopAppBarLeadingButtonContainer:

    MDActionTopAppBarButton:
    icon: "menu"

    MDTopAppBarTitle:
    text: "Página Principal"

    MDTopAppBarTrailingButtonContainer:

    MDActionTopAppBarButton:
    icon: "dots-vertical"


    Note: The code is executed and manages to display the window with the bar.

    I tried changing the md_bg_color option on different lines but it doesn't work, I also read the kivy documentation but it doesn't mention color so I'm afraid there is no such option. I hope someone has a solution.

    Thank you so much.

    Continue reading...

Compartilhe esta Página