How to solve the refresh problem brought by lv_obj_set_hidden?


I have a container. This container uses the LV_LAYOUT_GRID layout.
And I added 21 objects to this container.
Now, I use lv_obj_set_hidden to hide some objects, e.g.

for(uint_8 index = 0; index <= 20; index++)
    lv_obj_set_hidden(objets[index], true/false);

I found that I could see the refresh process for each object, But not if you’re creating 20 objects at once, Why?

It’s probably a side effect of the optimizations done on refresh areas. You can try invalidating the entire container - that might mitigate the effect somewhat. However, it’s probably better to optimize your screen refresh speed so these types of effects aren’t visible.

It works. Than you!