void myUiInit(void)
{
// 创建一个水平滑动条
lv_obj_t * ui_Indicator_Right = lv_slider_create(lv_scr_act());
// 设置滑动条的范围
lv_slider_set_range(ui_Indicator_Right, 0, 29);
// 设置滑动条的初始值
lv_slider_set_value(ui_Indicator_Right, 25, LV_ANIM_OFF);
// 如果滑动条的模式是范围模式,则设置左值
if (lv_slider_get_mode(ui_Indicator_Right) == LV_SLIDER_MODE_RANGE) lv_slider_set_left_value(ui_Indicator_Right, 0,LV_ANIM_OFF);
// 设置滑动条的宽度
lv_obj_set_width(ui_Indicator_Right, 33);
// 设置滑动条的高度
lv_obj_set_height(ui_Indicator_Right, 289);
// 设置滑动条的对齐方式
lv_obj_set_align(ui_Indicator_Right, LV_ALIGN_CENTER);
// 设置滑动条的主要部分的圆角
lv_obj_set_style_radius(ui_Indicator_Right, 4, LV_PART_MAIN | LV_STATE_DEFAULT);
// 设置滑动条的主要部分的背景颜色
lv_obj_set_style_bg_color(ui_Indicator_Right, lv_color_hex(0x272A33), LV_PART_MAIN | LV_STATE_DEFAULT);
// 设置滑动条的主要部分的背景透明度
lv_obj_set_style_bg_opa(ui_Indicator_Right, 255, LV_PART_MAIN | LV_STATE_DEFAULT);
// 设置滑动条的主要部分的背景主停止点
lv_obj_set_style_bg_main_stop(ui_Indicator_Right, 0, LV_PART_MAIN | LV_STATE_DEFAULT);
// 设置滑动条的主要部分的背景渐变停止点
lv_obj_set_style_bg_grad_stop(ui_Indicator_Right, 255, LV_PART_MAIN | LV_STATE_DEFAULT);
// 设置滑动条的主要部分的边框宽度
lv_obj_set_style_border_width(ui_Indicator_Right, 0, LV_PART_MAIN | LV_STATE_DEFAULT);
// 设置滑动条的主要部分的左边距
lv_obj_set_style_pad_left(ui_Indicator_Right, 2, LV_PART_MAIN | LV_STATE_DEFAULT);
// 设置滑动条的主要部分的右边距
lv_obj_set_style_pad_right(ui_Indicator_Right, 2, LV_PART_MAIN | LV_STATE_DEFAULT);
// 设置滑动条的主要部分的上边距
lv_obj_set_style_pad_top(ui_Indicator_Right, 0, LV_PART_MAIN | LV_STATE_DEFAULT);
// 设置滑动条的主要部分的下边距
lv_obj_set_style_pad_bottom(ui_Indicator_Right, 0, LV_PART_MAIN | LV_STATE_DEFAULT);
// 设置滑动条指示器的圆角
lv_obj_set_style_radius(ui_Indicator_Right, 4, LV_PART_INDICATOR | LV_STATE_DEFAULT);
// 设置滑动条指示器的背景颜色
lv_obj_set_style_bg_color(ui_Indicator_Right, lv_color_hex(0xFFFFFF), LV_PART_INDICATOR | LV_STATE_DEFAULT);
// 设置滑动条指示器的背景透明度
lv_obj_set_style_bg_opa(ui_Indicator_Right, 0, LV_PART_INDICATOR | LV_STATE_DEFAULT);
// 设置滑动条指示器的背景主停止点
lv_obj_set_style_bg_main_stop(ui_Indicator_Right, 0, LV_PART_INDICATOR | LV_STATE_DEFAULT);
// 设置滑动条指示器的背景渐变停止点
lv_obj_set_style_bg_grad_stop(ui_Indicator_Right, 255, LV_PART_INDICATOR | LV_STATE_DEFAULT);
// 设置滑动条指示器的背景图片
lv_obj_set_style_bg_img_src(ui_Indicator_Right, &indicator_ver, LV_PART_INDICATOR | LV_STATE_DEFAULT);
// 设置滑动条旋钮的背景颜色
lv_obj_set_style_bg_color(ui_Indicator_Right, lv_color_hex(0xFFFFFF), LV_PART_KNOB | LV_STATE_DEFAULT);
// 设置滑动条旋钮的背景透明度
lv_obj_set_style_bg_opa(ui_Indicator_Right, 0, LV_PART_KNOB | LV_STATE_DEFAULT);
}
现象: