How to align Text at the center with label.set_width() defined

Hello,

As I want to use long texts in a button widget with a circular scroll, I defined a label.set_width().
Unfortunately, with V8.1 (it worked on 7.1), I’m not able to align text at the center of the button if I define a width for the label, even if I use the label.align(lv.ALIGN.CENTER,0,0) or label.align(lv.TEXT_ALIGN.CENTER,0,0) command.
But it works if I delete the label.set_width() command.

Here an example of the code used :

scr = lv.obj()
btn = lv.btn(scr)
btn.align(lv.ALIGN.CENTER, 0, 0)
btn.set_size(210,40)
label = lv.label(btn)
label.set_width(200)
label.align(lv.TEXT_ALIGN.CENTER,0,0)
label.set_text('Hello World!')
lv.scr_load(scr)

Is there another way to align the text ?
Thanks

What MCU/Processor/Board and compiler are you using? ESP32 micropython and online simulator

What LVGL version are you using? 8.1

As discussed in Align Text at the center impossible with label.set_width() defined - #2 by amirgon, did you try this? : label.set_style_text_align(lv.TEXT_ALIGN.CENTER,0)

:+1: :+1: Oh yes it works.
I misread your first post reply in Align Text at the center impossible with label.set_width() defined - #2 by amirgon and I only changed the argument and not the name of the function :face_with_head_bandage:
Thank you for your help and your time !