I want to insert my image into the button, but I get an error when there is a Users element in my image path. is it possible to prescribe the path in some other way so that there are no errors?
from kivymd.app import MDApp
from kivymd.uix.label import MDLabel
from kivymd.uix.button import MDRectangleFlatButton
from kivymd.uix.gridlayout import MDGridLayout
class TestApp(MDApp):
def build(self):
layout = MDGridLayout(spacing=30, cols = 3, padding = 200)
btn1 = MDRectangleFlatButton(text="", icon="C:UsersAlenaDesktopicon")
btn2 = MDRectangleFlatButton(text="")
btn3 = MDRectangleFlatButton(text="")
layout.add_widget(btn1)
layout.add_widget(btn2)
layout.add_widget(btn3)
return layout
TestApp().run()
also, my images are in the same folder as my project
thank you all in advance for your help
New contributor
alena nikiforova is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.