[Python] How to replace deprecated ListView in kivy?

Discussão em 'Python' iniciado por Stack, Agosto 25, 2025.

  1. Stack

    Stack Membro Participativo

    I am studying kivy for now and reading Creating Apps with kivy. Author use follwing code:

    .kv

    AddLocationForm:

    <AddLocationForm@BoxLayout>:
    orientation : 'vertical'
    BoxLayout:
    pos : 100, 100
    height : '40dp'
    size_hint_y : None

    TextInput:
    size_hint_x : 50
    Button:
    text : 'search'
    size_hint_x : 25
    Button:
    text : 'current location'
    size_hint_x : 25
    ListView:
    item_strings: ["Palo Alto, MX", "Palo Alto, US"]


    and .py

    from kivy.app import App


    class FirstKivyApp(App):
    pass



    FApp = FirstKivyApp()
    FApp.run()


    But as much as I understand ListView is deprecated now. It is supposed to be changed on RecycleView now. I've checked for some solutions but they don't make sense for me because use things I've not accomplished yet. I tried to use

    RecycleView:
    data : ["Palo Alto, MX", "Palo Alto, US"]



    instead of ListView but it isn't shown whereas I can access the data through id and ObjectProperty. Is there a way to display data in simplier way, than using ScreenManager, constructing classes and referring to build method? For example something like in author's or my example, but working. Adding RecycleBoxLayout didn't work too.

    Continue reading...

Compartilhe esta Página