lvgl / lvgl

Embedded graphics library to create beautiful UIs for any MCU, MPU and display type.
https://lvgl.io
MIT License
15.99k stars 3.14k forks source link

Why can't the position of the first control be modified when the parent object is cont? #279

Closed as564335sa closed 6 years ago

as564335sa commented 6 years ago

Why can't the position of the first control be modified when the parent object is cont?

in the test: lv_obj_t * cont2 = lv_cont_create(lv_scr_act(), cont1); lv_cont_set_fit(cont2, true, true);

lv_obj_t * obj2_1 = lv_label_create(cont2, NULL);
lv_obj_set_pos(obj2_1, 100, 30);
lv_label_set_text(obj2_1, "Short");

lv_obj_t * obj2_2 = lv_label_create(cont2, NULL);
lv_label_set_text(obj2_2, "A longer text");
lv_obj_set_pos(obj2_2, 180, 30);

The position of “Short”does not change?

kisvegabor commented 6 years ago

Hi,

I updated the documentation of the container to explain it. See the "Notes" section here: https://littlevgl.com/object-types/container-lv_cont