< Kivy

A KV lista

KV lista példa

main.py
from kivy.app import App
from kivy.lang.builder import Builder
 
class OrarendApp(App):
    def build(self):
        screen = Builder.load_file('main.kv')
        screen.ids.rv.data= [
            {'text':'alma'}, 
            {'text':'körte'},
            {'text':'szilva'},
            {'text':'barack'},
            {'text':'cseresznye'},
            {'text':'meggy'}
            ]
        return screen
 
OrarendApp().run()

KV fájl:

main.kv
Screen:
    BoxLayout:
        orientation: 'vertical'
        Label:
            text: 'Gyümölcsök'
            size_hint_y: None
 
        RecycleView:
            id: rv
            viewclass: 'Label'
            RecycleBoxLayout:
                default_size: None, dp(56)
                default_size_hint: 1, None
                size_hint_y: None
                height: self.minimum_height
                orientation: 'vertical'