lvgl / lvgl

Embedded graphics library to create beautiful UIs for any MCU, MPU and display type.
https://lvgl.io
MIT License
16.68k stars 3.26k forks source link

clear last screen #645

Closed himsha closed 5 years ago

himsha commented 5 years ago

Hi, after creating screen or menu do we need to clear or delete created label graph extra once created from jumping from one screen to other and how to do it?

kisvegabor commented 5 years ago

Hi,

lv_scr_load won't delete anything. You can load the old screen again and it will have exactly the same content. Moreover, you can change objects even on the not loaded screen. E.g. create new objects or set size.

To save memory you can delete objects. But if you delete the whole screen, be sure this is not the active screen. (Load a new screen before deleting one)

himsha commented 5 years ago

any example? basically i am looking to create application with below detail

  1. splash screen (i had created but not able to erase it)
  2. menu page (similar as tab demo available but tab header is not required as max space in screen is consumed by header and its buttons)
  3. execution of each button available on menu (look similar to https://littlevgl.com/home/main_cover.png)
kisvegabor commented 5 years ago

Example of what exactly?

himsha commented 5 years ago

I had tried the tab object on stm32f746 but tab header consuming more space on screen is there is any option to customize header height or to remove them

embeddedt commented 5 years ago

@himsha I will try and give some suggestions for each of the points you listed above.

  1. splash screen (i had created but not able to erase it)

You should have a parent lv_obj that you set as the active screen with lv_scr_act. Then you can put your splash image, etc. on this lv_obj.

  1. menu page (similar as tab demo available but tab header is not required as max space in screen is consumed by header and its buttons)

If you don't need the multi-page facilities of tabview then do something similar to what I wrote above. Otherwise @kisvegabor can probably tell you how to disable the header.

  1. execution of each button available on menu (look similar to https://littlevgl.com/home/main_cover.png)

If you need a new screen for the button, again create a new lv_obj parent object to put all of the related widgets under.

himsha commented 5 years ago

@himsha I will try and give some suggestions for each of the points you listed above.

  1. splash screen (i had created but not able to erase it)

You should have a parent lv_obj that you set as the active screen with lv_scr_act. Then you can put your splash image, etc. on this lv_obj.

  1. menu page (similar as tab demo available but tab header is not required as max space in screen is consumed by header and its buttons)

If you don't need the multi-page facilities of tabview then do something similar to what I wrote above. Otherwise @kisvegabor can probably tell you how to disable the header.

  1. execution of each button available on menu (look similar to https://littlevgl.com/home/main_cover.png)

If you need a new screen for the button, again create a new lv_obj parent object to put all of the related widgets under.

thanks

kisvegabor commented 5 years ago

@himsha Unfortunately, there is no way to hide the button right now but you can apply this trick:

    lv_obj_set_height(tabview, LV_VER_RES + 30);
    lv_obj_set_y(tabview, -30);

So just move the upper part out of the screen and adjust the height accordingly.

embeddedt commented 5 years ago

@kisvegabor

Unfortunately, there is no way to hide the button right now...

From a quick read of lv_tabview_create this looks fairly simple to implement. I can send a PR if you want.

kisvegabor commented 5 years ago

@embeddedt It would be very welcome!

kisvegabor commented 5 years ago

@embeddedt Merged, thank you very much!

@himsha Please try this new feature and comment here is something is not working.