How to set the child obj to the real position


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

Simulator now

What LVGL version are you using?


What do you want to achieve?

When I create an obj from other obj.Child obj cant not set pos to near the border.
(I set the child obj pos to x=0,y=0,but the obj is not as my mind)

What have you tried so far?

I try to change the obj border width&outline width and pad.But it seems no change.

Code to reproduce

Add a code snippet which can run in the simulator. It should contain only the relevant code that compiles without errors when separated from your main code base.

The code block(s) should be formatted like:

    lv_obj_t *obj1 = lv_obj_create(lv_scr_act());
    lv_obj_set_pos(obj1, 0, 0);
    lv_obj_set_size(obj1, 240, 240);

    lv_obj_t *obj2 = lv_obj_create(obj1);
    lv_obj_set_pos(obj2, 0, 0);
    lv_obj_set_size(obj2, 100, 100);

Screenshot and/or video

If possible, add screenshots and/or videos about the current state.

It’s because of the padding of the parent.
See Positions, sizes, and layouts — LVGL documentation