Screen Layers

When an lv_display_t object is created, 4 permanent Screens that facilitate layering are created and attached to it.

  1. Bottom Layer (below Active Screen, transparent, not scroll-able, but click-able)

  2. Active Screen

  3. Top Layer (above Active Screen, transparent and neither scroll-able nor click-able)

  4. System Layer (above Top Layer, transparent and neither scroll-able nor click-able)

1, 3 and 4 are independent of the Active Screen and they will be shown (if they contain anything that is visible) regardless of which screen is the Active Screen.

Note

For the bottom layer to be visible, the Active Screen's background has to be at least partially, if not fully, transparent.

You can get pointers to each of these screens on the Default Display by using (respectively):

You can get pointers to each of these screens on a specified display by using (respectively):

To set a Screen you create to be the Active Screen, call lv_screen_load() or lv_screen_load_anim().

Top and System Layers

LVGL uses the Top Layer and System Layer two empower you to ensure that certain Widgets are always on top of other layers.

You can add "pop-up windows" to the Top Layer freely. The Top Layer was meant to be used to create Widgets that are visible on all Screens shown on a Display. But, the System Layer is intended for system-level things (e.g. mouse cursor will be placed there with lv_indev_set_cursor()).

These layers work like any other Widget, meaning they have styles, and any kind of Widgets can be created in them.

Note

While the Top Layer and System Layer are created by their owning Display (lv_display) as not scroll-able and not click-able, these behaviors can be overridden the same as any other Widget by using lv_obj_set_scrollbar_mode(scr1, LV_SCROLLBAR_MODE_xxx) and lv_obj_add_flag(scr1, LV_OBJ_FLAG_CLICKABLE) respectively.

If the LV_OBJ_FLAG_CLICKABLE flag is set on the Top Layer, then it will absorb all user clicks and acts as a modal Widget.

lv_obj_add_flag(lv_layer_top(), LV_OBJ_FLAG_CLICKABLE);

Bottom Layer

Similar to the Top- and System Layers, the Bottom Layer is also the full size of the Display, but it is located below the Active Screen. It's visible only if the Active Screen's background opacity is < 255.

Further Reading

Transparent Screens.