larena
June 12, 2023, 2:06pm
1
Description
What MCU/Processor/Board and compiler are you using?
Custom board with a STM32H753 MCU
What LVGL version are you using?
Latest v8.3 release
What do you want to achieve?
Vertical alignment for the text of a label.
What have you tried so far?
I found this old thread however seems to be updated by now since lv_obj_align_mid
is not present in the API anymore.
Tinus
June 12, 2023, 2:14pm
2
have you tried lv_obj_center()
?
larena
June 12, 2023, 2:23pm
3
If I’m not wrong that would center the label inside the parent object, but what I want is to center the text inside the label. Maybe I could use a container for the label, however I’d like to avoid it if I can.
Tinus
June 12, 2023, 2:26pm
4
I see. I’m fairly certain the
lv_obj_set_style_text_align()
function does that. See Label (lv_label) — LVGL documentation
larena
June 12, 2023, 3:23pm
5
Actually I think not; but I think the official solution as reported here is to use a container
1 Like