1 #include "../../lv_examples.h"
2 #if LV_USE_BAR && LV_BUILD_EXAMPLES
3
4 /**
5 * Bar with opposite direction
6 */
lv_example_bar_7(void)7 void lv_example_bar_7(void)
8 {
9 lv_obj_t * label;
10
11 lv_obj_t * bar_tob = lv_bar_create(lv_screen_active());
12 lv_obj_set_size(bar_tob, 20, 200);
13 lv_bar_set_range(bar_tob, 100, 0);
14 lv_bar_set_value(bar_tob, 70, LV_ANIM_OFF);
15 lv_obj_align(bar_tob, LV_ALIGN_CENTER, 0, -30);
16
17 label = lv_label_create(lv_screen_active());
18 lv_label_set_text(label, "From top to bottom");
19 lv_obj_align_to(label, bar_tob, LV_ALIGN_OUT_TOP_MID, 0, -5);
20 }
21
22 #endif
23