How create a text in the center of the page

Hi:
i want to show a text in the center of the lcd, but the text was be displayed at the first line of the lcd,
Please help me to check my codes, thanks!

LV_HOR_RES 320
LV_VER_RES 240
/Create a page/
if(info_page == NULL)
{
info_page = lv_page_create(lv_scr_act(), NULL);
lv_obj_set_size(info_page, LV_HOR_RES, LV_VER_RES);
lv_obj_align(info_page, NULL, LV_ALIGN_CENTER, 0, 0);
lv_page_set_style(info_page, LV_PAGE_STYLE_BG, &menu_bg_style);
lv_page_set_style(info_page, LV_PAGE_STYLE_SCRL, &menu_bg_style);
lv_page_set_style(info_page, LV_PAGE_STYLE_SB, &menu_bg_style);
lv_page_set_sb_mode(info_page, LV_SB_MODE_AUTO);
}

 lv_obj_t *label;
 /*second line fxo  info*/
 label = lv_label_create(info_page, NULL);
 lv_label_set_style(label, &menu_sel_style);
 lv_label_set_text(label, infoString);
 lv_obj_align(label, info_page,LV_ALIGN_IN_TOP_MID, 0,124);

Hi, you can modify like this

lv_obj_align(label, NULL, LV_ALIGN_CENTER, 0, 0);

I modify the code like this lv_obj_align(label, NULL, LV_ALIGN_CENTER, 0, 0); the problem also exist,

You can show some pictures about this.

Here you have to modify like this

lv_label_set_style(label, LV_LABEL_STYLE_MAIN, &menu_sel_style);
or
lv_obj_set_style(lable, &menu_sel_style);

my littevGL verison is 5.0, now the text dispotion is right, but some times the text will displayed at the (0,0),please see the video


You can see the picture, my demo have a countdown , the lcd will display the time in the center, but, sometime the text will display at the (0,0) like the “7s”

Hmm, can you show more code about the text update process?

Sorry, the code is too large, can you give me some advice to find the proplem?

Okay, that’s all right.
The important point is that the lv_style_t variable should be static or global variable, you can check it.

5.0 is very, very old… we don’t really support it anymore. Is there a reason why you can’t upgrade to 6.0, at the very least?