How to delete and create new screen using lvgl?

Hi,
i am working on a display with controller st7789 and touch driver cst816s on nrf52840.I am trying to make a smart watch screens using lvgl lib.

on my watch,i have 4 screens which changes on swipe gestures detected by touch driver.currently i am creating the objects(gif,labels) and when the gesture is detected,i delete the objects on current screen and again create the objects of next screen to be loaded(just like a noob).But i believe there are best methods to do so instead of creating and deleting the objects every time i change he screen on display.Can someone guide me how to do this in lvgl?anyt link to the documentation or example code will be appreciated.
Note:i am using c language.

Thanks

1 Like

@kisvegabor @embeddedt any inputs?

Hi,

What you are doing is fine. LVGL can create the widget very quickly. However you can also create the screens once during an initialization and just call e.g. lv_scr_load(screen2) to change screen.