<Affichage>:
#name: affichage
MDBoxLayout:
orientation: "vertical"
MDTabs:
do_default_tab: False
id: tabs
<Tab>:
""")
class Tab(MDFloatLayout, MDTabsBase):
'''Class implementing content for a tab.'''
icon = ObjectProperty()
class Affichage(MDFloatLayout, Screen):
def __init__(self, **kwargs):
super(Affichage, self).__init__(**kwargs)
#a = ["a","c","d","e"]
#for val in a:
#print(val)
for name_tab in APIJSON:
#print(name_tab['name'])
self.root.ids.tabs.add_widget(
Tab(
title= name_tab['name']
# icon=name_tab,ou
)
)
<homescreen>
MDBottomNavigationItem:
name: "Home screen"
icon: "home"
# Contenue de la section accueil
MDScrollView:
MDBoxLayout:
size_hint_y:0.9
orientation:"vertical"
MDBoxLayout:
padding:10
spacing:2
#md_bg_color:"orange"
size_hint_y:.3
MDLabel:
color: self.theme_cls.text_color
text:"Catégories"
#quelques liste des catégories
MDScrollView:
do_scroll_y: False
Affichage:
File "d:\kv\MesDemoKivy\Components\affichage.py", line 55, in __init__
self.root.ids.tabs.add_widget(
^^^^^^^^^
AttributeError: 'Affichage' object has no attribute 'root'