I decided to update kivy. Previously, there was no such error, now:
raise FactoryException('Unknown class <%s>' % name)
kivy.factory.FactoryException: Unknown class <NavigationLayout>
Code:
from kivy.lang import Builder
from kivymd.app import MDApp
from kivy.core.window import Window
Window.size = (600,550)
KV = '''
Screen:
NavigationLayout:
MDNavigationDrawer:
id: draver
BoxLayout:
orientation: 'vertical'
ScrollView:
MDList:
BoxLayout:
id: box
OneLineIconListItem:
on_press: app.star()
text: 'Избранное'
IconLeftWidget:
icon: 'star'
OneLineIconListItem:
text: 'Настройки'
IconLeftWidget:
icon: 'settings'
'''
class Test(MDApp):
def build(self):
return Builder.load_string(KV)
Test().run()
Please helppp
this is written because the site does not allow you to ask a question this is written because the site does not allow you to ask a question this is written because the site does not allow you to ask a question this is written because the site does not allow you to ask a question
You have to choose kivy or kivymdfor theses widgets: NavigationLayout MDNavigationDrawer.
Actually, you are melting the two libraries and they don't like it. Use:
MDNavigationLayout and MDNavigationDrawerNavigationLayout and NavigationDrawerUsing MDNavigationDrawer has changed!
You should now use this markup structure:
Root:
MDNavigationLayout:
ScreenManager:
...
...
MDNavigationDrawer:
UserContentNavigationDrawer:
MDNavigationDrawer is an empty MDCard class into which you add your own content.
i.e in summary change the NavigationLayout to MDNavigationLayout.
See this github page for more info:
https://github.com/kivymd/KivyMD/wiki/Components-Navigation-Drawer#using-mdnavigationdrawer-has-changed
I wonder why the official site hasn't been change, this update is about a year now!
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With