How to set label text in the center of label?

Try this:

lv_obj_set_style_text_align(main_angle , LV_TEXT_ALIGN_CENTER, 0);

From here: