Sunday, October 17, 2021

NavBar with Buttons

 

bbar.py


from kivy.lang import Builder

from kivymd.app import MDApp



class MainApp(MDApp):

    def build(self):

        self.theme_cls.theme_style = "Dark"

        self.theme_cls.primary_palette = "BlueGray"

        return Builder.load_file('bbar.kv')


MainApp().run()


bbar.kv


BoxLayout:

    orientation: 'vertical'


    MDToolbar:

        title: "Bottom Navbar"

        #md_bg_color: .2,.2,.2,1

        #specific_text_color: 0,1,0,1

    

    MDBottomNavigation:

        #panel_color: 0,1,0,.5

    

        MDBottomNavigationItem:

            name: "screen1"

            text: 'Python'

            icon: 'language-python'

            MDLabel:

                text: 'Python'

                halign: 'center'


        MDBottomNavigationItem:

            name: "screen2"

            text: 'Youtube'

            icon: 'youtube'

            MDLabel:

                text: 'Youttube Channel'

                halign: 'center'

        

        MDBottomNavigationItem:

            name: "screen3"

            text: 'Instagram'

            icon: 'instagram'

            MDLabel:

                text: 'My Instagram'

                halign: 'center'


Notes:

Background color

     #md_bg_color: .2,.2,.2,1

Text color

    #specific_text_color: 0,1,0,1

Panel background color

    #panel_color: 0,1,0,.5

Icons can be found here:

http://zavoloklom.github.io/material-design-iconic-font/icons.html

or

https://materialdesignicons.com/