hi, i’m having a problem trying to hide the scroll bar of a particular obj here is a menu cont, it seems the lv_obj_set_scrollbar_mode function is not working. Did I do something wrong somewhere?
i use lvgl 8.3
static void create_setting_address(lv_obj_t *cont) {
lv_obj_set_flex_flow(cont, LV_FLEX_FLOW_COLUMN);
lv_obj_set_scroll_snap_y(cont, LV_SCROLL_SNAP_CENTER);
lv_obj_set_scrollbar_mode(cont, LV_SCROLLBAR_MODE_OFF);
for (uint8_t i = 'A'; i <= 'H'; i++) {
lv_obj_t *lv_btn = lv_btn_create(cont);
lv_obj_set_width(lv_btn, lv_pct(100));
lv_obj_set_flex_flow(lv_btn, LV_FLEX_FLOW_ROW);
lv_color_t color = lv_obj_get_style_bg_color(cont, LV_PART_MAIN);
lv_obj_set_style_bg_color(lv_btn, color, LV_PART_MAIN);
lv_obj_set_style_border_opa(lv_btn, 0, 0);
lv_obj_set_style_shadow_opa(lv_btn, 0, 0);
lv_obj_t *label = lv_label_create(lv_btn);
lv_obj_set_style_text_color(lv_btn, lv_color_hex(0x000000), 0);
lv_label_set_text_fmt(label, " %c", i);
// TODO thêm event lưu tên người thao tác
}
}
void create_menu (void) {
//... something
lv_obj_t *cont;
lv_obj_t *label;
lv_obj_t *sub_1_page = lv_menu_page_create(setting, "");
cont = lv_menu_cont_create(sub_1_page);
create_setting_address(cont);
}