I get this error: kivy.factory.FactoryException: Unknown class
Maybe my tabs.kv is a bit wrong but I dunno in my case where or how to put TabbedPanel class.
My header.kv
<Header>
name: 'header'
orientation: 'vertical'
BoxLayout:
orientation: 'vertical'
MDTopAppBar:
title: "Demo"
left_action_items: [["menu", lambda x: nav_drawer.set_state("open")]]
elevation: 4 # shadow
font_size: 14
md_bg_color: 0.21, 0.34, 0.43, 1 # 0,0 100/255, 1
Widget:
MDNavigationDrawer:
id: nav_drawer
BoxLayout: # for the navigation drawer content
orientation: 'vertical'
spacing: '8dp'
padding: '8dp'
Image:
source: 'byard.png'
MDLabel:
text: 'Alejandro'
font_style: 'Subtitle1'
size_hint_y: None
height: self.texture_size[1]
MDLabel:
text: 'test'
font_style: 'Caption'
size_hint_y: None
height: self.texture_size[1]
ScrollView:
MDList:
OneLineIconListItem:
text: 'Profile'
IconLeftWidget:
icon: 'account'
OneLineIconListItem:
text: 'Email'
IconLeftWidget:
icon: 'email'
And my tabs.kv
<Tabs>
name: 'tabs'
orientation: 'vertical'
Tabbedpanel
do_default: False
TabbedPanelItem:
text: "Start here"
Label:
text: "Hello"
TabbedPanelItem:
text: "Benefits"
BoxLayout:
Button:
text: "Mental"
Button:
text: "Physical"
Button:
text: "Emotional"
Button:
text: "Spiritual"
TabbedPanelItem:
text: "Quotes"
Image:
source: "byard.png"
Lastly my main.kv
ScreenManager:
Header:
Tabs:
My main.py file
from kivy.core.window import Window # keeps it mobile size when testing
Window.size = (360,600) # remove this when the app is done
from kivymd.app import MDApp
from kivy.uix.screenmanager import Screen, ScreenManager
from kivy.lang import Builder
from kivymd.uix.textfield import MDTextFieldRect
class Header(Screen):
pass
class Tabs(Screen):
pass
sm = ScreenManager()
sm.add_widget(Header(name='header'))
sm.add_widget(Tabs(name='tabs'))
class MainApp(MDApp):
def build(self):
self.theme_cls.theme_style = "Light"
self.theme_cls.primary_palette = "Blue"
sm = Builder.load_file("Main.kv")
return sm
MainApp().run()
What I am trying to do is like the photo shows, to have my TabbedPanel and its tabs under the header (MDTopAppBar). I have separate kv files and its all interconnected but I'm missing something with TabbedPanel as that is causing error. Partially it could be bad syntax or indentation i guess but i think i dont know where to assign Tabbed panel or how