lv_obj_align is not an anchor. It is merely a convenient way of positioning an object. When you use an animation it will change the coordinates itself, and not use lv_obj_align.
lv_obj_align can be called as many times as you want (not just at object creation), but it’s not an anchor (you have to call it again if you resize the parent).
Actually, there is a way to “anchor” objects. It’s called “auto realign”.
If you enable lv_obj_set_auto_realign(obj, true) and then call lv_obj_align(...) the library will save parameters from lv_obj_align() and reapply them when the size has changed.
You can enable this feature with LV_USE_OBJ_REALIGN 1 in lv_conf.h
Hi! Sorry for resuming this old post, but I’m currently facing a similar issue.
I have 2 objects on the screen, one one the left and one on the right, which split the screen in two parts. After some time I would like to let the left item to smoothly transition of of view on the left and having the right one to fill the entire screen (i.e. align itself to the left border of the screen).
Moving the left object out of screen is easy by setting up an lv_style_transition_dsc_t. The problem is that the right object does not follow it. Of course the two are aligned with lv_obj_align_to on creation.
I just looked for LV_USE_OBJ_REALIGN but I didn’t find any reference. Was that symbol renamed or the feature treated differently?
Edit: I forgot to mention that I’m using version 8.3
Thanks for your reply! The version is not really a problem: I’m using 8.3 because that was the last official release when I started working on my project, but I can switch
Question: is there already an issue associated with this in GitHub? In case I’m willing to contribute, do you think this might be a “good first issue” to start from?