Ниже приведен мой код и снимок экрана OneLineIconListItem с двумя значками, которые я получаю.
Код: Выделить всё
OneLineIconListItem class code:
class SongList(OneLineIconListItem):
song = StringProperty() # to store song title
The .kv for SongList:
:
text: root.song
IconLeftWidget:
icon: "arrow-right-drop-circle"
The fetch function:
if emo_detected == "happy":
happy_query = "SELECT SongName FROM songs_list WHERE SongCluster=1 ORDER BY RAND() LIMIT 10"
self.cursor.execute(happy_query)
happy_songs = self.cursor.fetchall()
for i in happy_songs:
rechappy = SongList()
rechappy.song = i[0]
self.wm.screens[3].ids['recommended_song_list'].add_widget(rechappy)
MDList where I want to put the OneLineIconListItem:
ScrollView:
bar_width: 0
MDList:
id: recommended_song_list

Подробнее здесь: https://stackoverflow.com/questions/729 ... ows-2-icon
Мобильная версия