pythonkivy

Kivy's Label goes Blank after handling too much data


I'm new to both Kivy and Python and we have a Label that is exceeding texture size in ScrollView when a new flow of data is fed to it upon scan triggered by a Button. Let's say in the Pixel 7 emulator, when texture size of Label on y axis exceeds hardware's texture size limit: 8192 that Label goes blank/black but it is still possible to scroll through but nothing is visible apart from the top information e.g., Buttons or other Widgets.

I've been looking through the internet hoping to find an answer however, it is a pointless search. Some users refer to RecycleView but Kivy documentation does not make it easy implementing it and from my understanding RV is designed to handle bigger influx of data and is more memory efficient. Question is, does RV also help with texture size limitations?

I came across an article (cannot find link to it) which led me reading up on ScrollLabel but the repository on Git seems dead.


Solution

  • We have adapted our app to work with RecycleView. It is not a begineer friendly way of implementing scrolling in your app but is better than ScrollView if you're handling lots of data information. To my understanding, it doesn't worry so much about exceeding texture_size as above but lazy-loads and recycles your widgets. I'm surprised how ScrollView hasn't been deprecated yet, but after writing RV's... Kivy needs to find an easier way of implementing them otherwise it's a hassle.

    I would recommend closely studying the docs on Kivy, removing and adding stuff as you seem to fit to see how everything functions. To my knowledge, it is much easier to use Kivy's builder from kivy.lang.builder to define your RV (RecycleView) in .kv lang and it's widgets. Use Kivy's Properties as it makes everything easier to reference. Make sure how Classes work in Python! At least, understand the basics. Even I until today don't know what super() does.

    Links that helped us:

    And many, many, many StackOverflow posts...