Skip to content

Latest commit

 

History

History
79 lines (52 loc) · 1.76 KB

tileview.rst

File metadata and controls

79 lines (52 loc) · 1.76 KB

Tile view (lv_tileview)

Overview

The Tile view is a container object whose elements (called tiles) can be arranged in grid form. A user can navigate between the tiles by swiping. Any direction of swiping can be disabled on the tiles individually to not allow moving from one tile to another.

If the Tile view is screen sized, the user interface resembles what you may have seen on smartwatches.

Parts and Styles

The Tile view is built from an lv_obj container and lv_obj tiles.

The parts and styles work the same as for lv_obj.

Usage

Add a tile

:cpplv_tileview_add_tile(tileview, row_id, col_id, dir) creates a new tile on the row_idth row and col_idth column. dir can be LV_DIR_LEFT/RIGHT/TOP/BOTTOM/HOR/VER/ALL or OR-ed values to enable moving to the adjacent tiles into the given direction by swiping.

The returned value is an lv_obj_t * on which the content of the tab can be created.

Change tile

The Tile view can scroll to a tile with :cpplv_tileview_set_tile(tileview, tile_obj, LV_ANIM_ON/OFF) or :cpplv_tileview_set_tile_by_index(tileview, col_id, row_id, LV_ANIM_ON/OFF)

Events

  • :cppLV_EVENT_VALUE_CHANGED Sent when a new tile loaded by scrolling. :cpplv_tileview_get_tile_active(tabview) can be used to get current tile.

Keys

Keys are not handled by the Tile view.

Learn more about indev_keys.

Example

API