1 #include "../lv_examples.h" 2 #if LV_BUILD_EXAMPLES && LV_USE_LABEL 3 4 /** 5 * Basic example to create a "Hello world" label 6 */ lv_example_get_started_1(void)7void lv_example_get_started_1(void) 8 { 9 /*Change the active screen's background color*/ 10 lv_obj_set_style_bg_color(lv_screen_active(), lv_color_hex(0x003a57), LV_PART_MAIN); 11 12 /*Create a white label, set its text and align it to the center*/ 13 lv_obj_t * label = lv_label_create(lv_screen_active()); 14 lv_label_set_text(label, "Hello world"); 15 lv_obj_set_style_text_color(lv_screen_active(), lv_color_hex(0xffffff), LV_PART_MAIN); 16 lv_obj_align(label, LV_ALIGN_CENTER, 0, 0); 17 } 18 19 #endif 20