In this video I’ll show you how to build a bottom Navbar with Icons for KivyMD and Python.
We’ll create a MDToolbar with MDBottomNavigation and we’ll set the MDBottomNavigationItem to have icons that you can click on and have things change based on clicking.
I’ll also show you where to find icons for KivyMY,
hint: http://zavoloklom.github.io/material-design-iconic-font/icons.html
#kivy #codemy
Python Code: bbar.py
GitHub Code: 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()
Kivy Design Code: bbar.kv
GitHub Code: bbar.kv
BoxLayout: orientation: 'vertical' MDToolbar: title: "Bottom Navbar" md_bg_color: .2,.2,.2,1 specific_text_color: 1,1,1,1 MDBottomNavigation: #color stuff #panel_color: 0,0,1,1 MDBottomNavigationItem: name: 'screen 1' text: "Python" icon: 'language-python' MDLabel: text: "Python" halign: 'center' MDBottomNavigationItem: name: 'screen 2' text: "Youtube" icon: 'youtube' MDLabel: text: "Codemy YouTube Channel Rocks!" halign: 'center' MDBottomNavigationItem: name: 'screen 3' text: "Instagram" icon: 'instagram' MDLabel: text: "My Instagram:\nrealjohnelder" halign: 'center'
How can i adjust the size of navbar to fit my text and icon ?