mirror of
https://github.com/lvgl/lvgl.git
synced 2026-05-30 23:51:54 +08:00
fix(tileview): on size change auto. update the pos. of the tiles (#5577)
This commit is contained in:
committed by
GitHub
parent
2422f57358
commit
672f79fcca
@@ -70,8 +70,7 @@ lv_obj_t * lv_tileview_add_tile(lv_obj_t * tv, uint8_t col_id, uint8_t row_id, l
|
|||||||
|
|
||||||
lv_obj_t * obj = lv_obj_class_create_obj(&lv_tileview_tile_class, tv);
|
lv_obj_t * obj = lv_obj_class_create_obj(&lv_tileview_tile_class, tv);
|
||||||
lv_obj_class_init_obj(obj);
|
lv_obj_class_init_obj(obj);
|
||||||
lv_obj_set_pos(obj, col_id * lv_obj_get_content_width(tv),
|
lv_obj_set_pos(obj, lv_pct(col_id * 100), lv_pct(row_id * 100));
|
||||||
row_id * lv_obj_get_content_height(tv));
|
|
||||||
|
|
||||||
lv_tileview_tile_t * tile = (lv_tileview_tile_t *)obj;
|
lv_tileview_tile_t * tile = (lv_tileview_tile_t *)obj;
|
||||||
tile->dir = dir;
|
tile->dir = dir;
|
||||||
|
|||||||
Reference in New Issue
Block a user