mirror of
https://github.com/lvgl/lvgl.git
synced 2025-01-14 06:42:58 +08:00
25 lines
611 B
C
25 lines
611 B
C
#include "../../lv_examples.h"
|
|
#if LV_USE_SCALE && LV_BUILD_EXAMPLES
|
|
|
|
/**
|
|
* A simple horizontal scale
|
|
*/
|
|
void lv_example_scale_1(void)
|
|
{
|
|
lv_obj_t * scale = lv_scale_create(lv_screen_active());
|
|
lv_obj_set_size(scale, lv_pct(80), 100);
|
|
lv_scale_set_mode(scale, LV_SCALE_MODE_HORIZONTAL_BOTTOM);
|
|
lv_obj_center(scale);
|
|
|
|
lv_scale_set_label_show(scale, true);
|
|
|
|
lv_scale_set_total_tick_count(scale, 31);
|
|
lv_scale_set_major_tick_every(scale, 5);
|
|
|
|
lv_scale_set_major_tick_length(scale, 10);
|
|
lv_scale_set_minor_tick_length(scale, 5);
|
|
lv_scale_set_range(scale, 10, 40);
|
|
}
|
|
|
|
#endif
|