I was able to find this example of kivymd handling scrollview with MDlist. I am struggling to make it run.
The I am not familiar with the error code i am receiving and I was unsuccessful finding any help so far .
Here is the code :
from kivy.lang import Builder
from kivy.uix.scrollview import ScrollView
from kivymd.app import MDApp
kv =""""
<scrollview>
ScrollView:
do_scroll_x: False # Important for MD compliance
MDList:
OneLineListItem:
text: "Single-line item"
TwoLineListItem:
text: "Two-line item"
secondary_text: "Secondary text here"
ThreeLineListItem:
text: "Three-line item"
secondary_text: "This is a multi-line label where you can fit more text than usual"
"""
class MainApp(MDApp):
def build(self):
self.root_widget = Builder.load_string(kv)
sv = ScrollView()
ml = MDList()
sv.add_widget(ml)
contacts = ["Paula", "John", "Kate", "Vlad"]
for c in contacts:
ml.add_widget(
OneLineListItem(
text=c
)
)
return self.root_widget
if __name__ == '__main__':
MainApp().run()
Please Help !