api(align) save align in style and handle x/y according to it

This commit is contained in:
Gabor Kiss-Vamosi
2021-03-25 16:14:17 +01:00
parent 53f3cc1827
commit a2f3022188
92 changed files with 271 additions and 197 deletions

View File

@@ -13,14 +13,14 @@ void lv_example_label_1(void)
"and wrap long text automatically.");
lv_obj_set_width(label1, 150); /*Set smaller width to make the lines wrap*/
lv_obj_set_style_text_align(label1, LV_PART_MAIN, LV_STATE_DEFAULT, LV_TEXT_ALIGN_CENTER);
lv_obj_align(label1, NULL, LV_ALIGN_CENTER, 0, -40);
lv_obj_align(label1, LV_ALIGN_CENTER, 0, -40);
lv_obj_t * label2 = lv_label_create(lv_scr_act());
lv_label_set_long_mode(label2, LV_LABEL_LONG_SCROLL_CIRCULAR); /*Circular scroll*/
lv_obj_set_width(label2, 150);
lv_label_set_text(label2, "It is a circularly scrolling text. ");
lv_obj_align(label2, NULL, LV_ALIGN_CENTER, 0, 40);
lv_obj_align(label2, LV_ALIGN_CENTER, 0, 40);
}
#endif