How to configure UI full page

Hi. I have a question.

If I have a lot of UI pages and I have a product that moves those pages, how should I structure it?

Do I need to draw all the pages (hide / show)?

Thank you.

Hi,

It all deppends on your system spec and requirements:

Draw pages dinamically

You assemble every page with given configuration once the device turns-on.
It consumes loads of RAM, every page and its objects are allocated. On the other hand, switching between pages is faster (just draw objects needs to be done).

Static page drawing + show/hide

You shape the page before drawing it. This means that only the page showing in the screen and its objects are eating RAM. On the other hand, switching between pages is slower (create and draw objects needs to be done).

You can think of any element which will be repeated throughout pages, for example, a header. And leave it always alive.

If using a static page drawing always remember to free the objects of the leaving page. Otherwise, a memory leak will appear.

If using a static page drawing always remember to free the objects of the leaving page. Otherwise, a memory leak will appear.

Can you describe a case where you’ve seen this? Usually if you lv_obj_del the page it should also delete all of the child objects.

Effectively, that is the way to do it. I was talking in a general manner (dynamic vs static).

The CPU you are using now is a high performance of 400Mhz and 10MB of SRAM.
If all of the above are plotted and displayed, should I hide / show the page in the same way?

Sorry for late reply, I’ve been out.

I don’t understand your question. Is up to you to decide using one way or another. You even can test both and see which one fits you better.

Yes, thank you. I wanted to know which method is better. Let’s test it.