I’m trying to reduce the padding to set the spacing between menu items to 0, but it isn’t working as expected. I’ve read the information below, but I’m curious about how to reduce the internal padding of the menu items themselves.
menu_cont = lv_menu_cont_create(page);
lv_obj_clear_flag(menu_cont, LV_OBJ_FLAG_SCROLLABLE);
lv_obj_set_flex_flow(menu_cont, LV_FLEX_FLOW_ROW);
lv_obj_set_size(menu_cont, 1050, 360);
lv_obj_set_style_pad_all(menu_cont, 0, 0);
lv_obj_set_flex_align(menu_cont, LV_FLEX_ALIGN_START, LV_FLEX_ALIGN_START, LV_FLEX_ALIGN_START);
const lv_image_dsc_t * left_btn_images[4] = {
&time_n,
&sound_n,
&display_n,
&version_n,
};
const char *system_menu_text[] = {"time", "sound", "display", "version"};
for(int i = 0; i < 4; i++){
btn_cont = lv_menu_cont_create(menu_cont);
lv_obj_clear_flag(btn_cont, LV_OBJ_FLAG_SCROLLABLE);
lv_obj_set_style_pad_all(btn_cont, 0, LV_PART_MAIN | LV_STATE_DEFAULT);
lv_obj_set_style_outline_width(btn_cont, 0, LV_PART_MAIN | LV_STATE_DEFAULT);
lv_obj_set_style_border_width(btn_cont, 0, LV_PART_MAIN | LV_STATE_DEFAULT);
lv_obj_add_flag(btn_cont, LV_OBJ_FLAG_CLICKABLE);
lv_obj_set_size(btn_cont, 250, 360);
img_cont = lv_image_create(btn_cont);
lv_image_set_src(img_cont, left_btn_images[i]);
lv_obj_set_style_bg_opa(img_cont, LV_OPA_COVER, LV_PART_MAIN);
lv_obj_set_user_data(img_cont, (void *)"PARKING_POWER");
lv_obj_add_event_cb(img_cont, lv_main_event_cb, LV_EVENT_CLICKED, NULL);
btn_label = lv_label_create(img_cont);
lv_obj_set_style_bg_color(btn_label, lv_color_hex(0x0ff000), 0);
lv_label_set_text_fmt(btn_label, system_menu_text[i]);
lv_obj_align(btn_label, LV_ALIGN_CENTER, 0, 30);
}