In this video I’ll show you how to teach yourself KivyMD quickly and easily!

In the last video we looked at the Kitchen Sink app which shows you all of the different elements that you can use in KivyMD. In this video I’ll show you how to dive into the code and actually learn how to use each of those elements.

KivyMD comes with some fantastic documentation that shows you exactly how to use any of the elements you see in the Kitchen Sink App.

We’ll take a look at that documentation and use it to create a card and a slider in this video. You’ll see just how easy it is!

Python Code: testing.py
GitHub Code: testing.py

from kivy.app import App
from kivy.uix.widget import Widget
from kivy.properties import ObjectProperty
from kivy.lang import Builder
from kivymd.app import MDApp


# Designate Our .kv design file 
Builder.load_file('testing.kv')

class MyLayout(Widget):
	pass

class AwesomeApp(MDApp):
	def build(self):
		return MyLayout()


if __name__ == '__main__':
	AwesomeApp().run()


Kivy Design Code: testing.kv
GitHub Code: testing.kv

<MyLayout>
	BoxLayout:
		orientation: "vertical"
		size: root.width, root.height

		Screen:
			MDCard:
				orientation: "vertical"
				padding: "8dp"
				size_hint: None, None
				size: "280dp", "180dp"
				pos_hint: {"center_x": .5, "center_y": .5}

				MDLabel:
					text: "Title"
					theme_text_color: "Secondary"
					size_hint_y: None
					height: self.texture_size[1]

				MDSeparator:
					height: "1dp"

				MDLabel:
					text: "Body"

		Screen
			MDSlider:
				min: 0
				max: 100
				value: 40

John Elder

John is the CEO of Codemy.com where he teaches over 100,000 students how to code! He founded one of the Internet's earliest advertising networks and sold it to a publicly company at the height of the first dot com boom. After that he developed the award-winning Submission-Spider search engine submission software that's been used by over 3 million individuals, businesses, and governments in over 42 countries. He's written several Amazon #1 best selling books on coding, and runs a popular Youtube coding channel.

View all posts

Add comment

Your email address will not be published. Required fields are marked *

John Elder