{{tag>python code}} ====== RecycleView ====== from kivy.app import App from kivy.lang import Builder from kivy.uix.button import Button from kivy.uix.recycleview import RecycleView from kivy.uix.boxlayout import BoxLayout items = [ {"color":(1, 1, 1, 1), "font_size": "20sp", "text": "white", "input_data": ["some","random","data"]}, {"color":(.5,1, 1, 1), "font_size": "30sp", "text": "lightblue", "input_data": [1,6,3]}, {"color":(.5,.5,1, 1), "font_size": "40sp", "text": "blue", "input_data": [64,16,9]}, {"color":(.5,.5,.5,1), "font_size": "70sp", "text": "gray", "input_data": [8766,13,6]}, {"color":(1,.5,.5, 1), "font_size": "60sp", "text": "orange", "input_data": [9,4,6]}, {"color":(1, 1,.5, 1), "font_size": "50sp", "text": "yellow", "input_data": [852,958,123]}, {"color":(.5,1, 1, 1), "font_size": "30sp", "text": "lightblue", "input_data": [1,6,3]}, {"color":(.5,.5,1, 1), "font_size": "40sp", "text": "blue", "input_data": [64,16,9]}, {"color":(.5,.5,.5,1), "font_size": "70sp", "text": "gray", "input_data": [8766,13,6]}, {"color":(1,.5,.5, 1), "font_size": "60sp", "text": "orange", "input_data": [9,4,6]}, {"color":(1, 1,.5, 1), "font_size": "50sp", "text": "yellow", "input_data": [852,958,123]} ] class VideoItem(BoxLayout): pass KV = ''' : color: (.5, 1, 1, 1) # value here doesn't matter, its just a placeholder, doesn't work without this font_size: 1 # value here doesn't matter text: "text" # value here doesn't matter input_data: self.input_data # value here doesn't matter orientation: 'horizontal' Button: color: root.color font_size: root.font_size text: root.text Button: color: root.color font_size: root.font_size text: root.text Button: color: root.color font_size: root.font_size text: root.text RecycleView: data: [] viewclass: 'VideoItem' RecycleBoxLayout: default_size: None, None default_size_hint: 1, None size_hint_y: None height: self.minimum_height orientation: 'vertical' ''' class Test(App): def build(self): root = Builder.load_string(KV) root.data = [item for item in items] return root Test().run( ====== See also ====== [[wiki:kivy_custom_size_widgets|Custom widget size example]]