How to reset obj's align data to the default value?

Description

I would like to return align data of the object to the default value.
Is there any API function for resetting to the align-default?

Thank you.

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

  • ESP32

What do you want to achieve?

As the upper description.

What have you tried so far?

Code to reproduce

Screenshot and/or video

Why don’t you delete the object then recreate it ?

That would be quite inefficient with regards to performance.

If you are not using auto realign, you can just set the position of the object with lv_obj_set_pos.

If you are using auto realign, you should disable it (lv_obj_set_auto_realign(obj, false))and then use the steps above.

1 Like

ttxs1002004
Why don’t you delete the object then recreate it ?

Thank you for advice.

embeddedt
If you are not using auto realign, you can just set the position of the object with lv_obj_set_pos .

If you are using auto realign, you should disable it ( lv_obj_set_auto_realign(obj, false) )and then use the steps above.

Thank you for the solution.