Is there a way to update widget size recursively after screen resolution update?


What MCU/Processor/Board and compiler are you using?


What LVGL version are you using?


What do you want to achieve?

I need to recalculate position and size of widgets after screen rotation or resolution update.

What have you tried so far?


Code to reproduce


Screenshot and/or video


You can either use layouts or structure your code in such a way that you can call a function to recalculate the sizes of the objects. Aside from layouts there’s no built-in solution for handling this, as needing to resize the screen is not a common requirement.

Looks like I’ve found a solution. I can create a page/cont/win based layout and then recalculate relative position on LV_SIGNAL_STYLE_CHG. Of cource after changing resolution I need to call lv_obj_refresh_style function.