gpt4 book ai didi

python - NavigationLayout Kivy err0r

转载 作者:行者123 更新时间:2023-12-05 02:02:18 27 4
gpt4 key购买 nike

我决定更新 kivy。以前是没有这个错误的,现在:

raise FactoryException('Unknown class <%s>' % name)
kivy.factory.FactoryException: Unknown class <NavigationLayout>

代码:

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()

请帮忙

写这篇文章是因为该站点不允许您提问这是写的,因为该网站不允许您提问这是写的,因为该网站不允许您提问这是因为该网站不允许您提问

最佳答案

您必须为这些小部件选择 kivykivymd:NavigationLayout MDNavigationDrawer

实际上,你正在融化两个库,他们不喜欢它。使用:

  • MDNavigationLayoutMDNavigationDrawer
  • NavigationLayoutNavigationDrawer

关于python - NavigationLayout Kivy err0r,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/65898617/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com