Reputation: 21
I'm implementing a recycleview in kivy. It is possible have multiple (one or more) viewclass depending the dataset data? i would like to have in the same list multiple layouts (eg. one line viewclass1 (one label and two buttons) and another line viewclass2 (one label and two TextInput). Thank you.
Upvotes: 2
Views: 1302
Reputation: 11
You can create a widget that extends a layout and then you could add the widgets you need programmatically.
Upvotes: 1
Reputation: 41
I don't think you can have lines with different viewclasses
in a single RecycleView
. RecycleView
,by design, has only one viewclass
because it is meant for a large collection of homogeneous items.
For what you are looking for the most straightforward way is probably to use ScrollView
and to define a custom add_line(self, type):
function to dynamically add each line specifying the type
.
Upvotes: 0