Hi Team,
When the arc knob dragged the background of the arc changed.
i just added style_bg for arc and not changing arc bg any where. why the background changes to white?
//style_bg
static lv_style_t style_bg;
lv_style_init(&style_bg);
lv_style_set_bg_color(&style_bg,LV_STATE_DEFAULT, LV_COLOR_BG);
lv_obj_add_style(lv_scr_act(),LV_OBJ_PART_MAIN, &style_bg);
/*Create an Arc*/
dimmer = lv_arc_create(lv_scr_act(), NULL);
lv_obj_set_size(dimmer, 350, 350);
lv_arc_set_adjustable(dimmer,true);
lv_arc_set_range(dimmer,0,100);
lv_obj_add_style(dimmer,LV_OBJ_PART_MAIN, &style_bg);
lv_obj_align(dimmer, NULL, LV_ALIGN_CENTER, 0, 0);
lv_obj_set_event_cb(dimmer, arc_event_cb);
//event handler
static void arc_event_cb(lv_obj_t * dimmer, lv_event_t event)
{
static char buf[4];
if(event == LV_EVENT_RELEASED){
snprintf(buf, 4, "%u", lv_arc_get_value(dimmer));
if(buf==0){
lv_label_set_text(level,strcat(buf," %"));
}else if(buf>0){
lv_label_set_text(level,strcat(buf," %"));
}
}
}
i am using style_bg for arc background. please find the above code.
when i drag the knob the background of the arc changed to white.
Please find the attached images
Image with style_bg:
image after knob changed:
Please help me with this.
Thanks in Advance.