Description
Hey everyone here,I’ve used Roller recently to try some different show effects from widget List.And then I found a thing that Roller will collide with other widgets(e.g. brother widgets) when scrolling in their parent,just because Roller is rolling up or down while scrolling direction is left or right,and if I scroll obliquely,then collisions comes.
I haven’t find a good way to fix this yet.Is there anybody could give me a solution?
What LVGL version are you using?
released 8.3.0
Code to reproduce
/* My code here,quite simple example*/
lv_obj_t *panel = lv_obj_create(lv_scr_act());
lv_obj_t *obj_main = lv_obj_create(panel);
lv_obj_t *obj_title = lv_label_create(obj_main);
lv_obj_t *obj_other = lv_obj_create(panel);
lv_obj_t *obj_roller = lv_roller_create(obj_other);
// Size
lv_obj_set_size(panel, 240, 240); // Screen size is 240*240
lv_obj_set_size(obj_main, 240, 240);
lv_obj_set_size(obj_other, 240, 240);
// Text
lv_label_set_text(obj_title, "Main Page");
lv_roller_set_options(obj_roller, "First Item\n"
"Seconde Item\n"
"Third Item\n"
"Fourth Item\n",
LV_ROLLER_MODE_NORMAL);
// Location
lv_obj_center(obj_main);
lv_obj_center(obj_title);
lv_obj_align_to(obj_other, obj_main, LV_ALIGN_OUT_RIGHT_TOP, 0, 0);
lv_obj_center(obj_roller);
// Styles
lv_roller_set_visible_row_count(obj_roller, 3);
lv_roller_set_selected(obj_roller, 0, LV_ANIM_OFF);
lv_obj_set_style_text_color(obj_title, lv_color_white(), 0);
lv_obj_set_style_text_color(obj_roller, lv_color_white(), LV_PART_SELECTED);
lv_obj_set_style_text_color(obj_roller, lv_color_white(), 0);
lv_obj_set_style_bg_color(obj_main, lv_color_black(), 0);
lv_obj_set_style_bg_color(obj_other, lv_color_black(), 0);
lv_obj_set_style_bg_color(obj_roller, lv_color_black(), 0);
lv_obj_set_style_bg_color(obj_roller, lv_color_black(), LV_PART_SELECTED);
lv_obj_set_style_bg_opa(obj_roller, LV_OPA_TRANSP, 0);
lv_obj_set_style_bg_opa(obj_roller, LV_OPA_TRANSP, LV_PART_SELECTED);
lv_obj_set_scrollbar_mode(panel, LV_SCROLLBAR_MODE_OFF);
lv_obj_set_scroll_snap_x(panel, LV_SCROLL_SNAP_CENTER);
// Flags
lv_obj_add_flag(panel, LV_OBJ_FLAG_SCROLL_ONE);
lv_obj_clear_flag(panel, LV_OBJ_FLAG_SCROLL_ELASTIC);