Description
I have a table where I have font size 24 for the header and 18 for the rows.
How can I set the padding for the 1+ rows?
What MCU/Processor/Board and compiler are you using?
Simulator and Linux
What LVGL version are you using?
8.3
What do you want to achieve?
As description
What have you tried so far?
Ive not found much I can use
Code to reproduce
info.batterytable = lv_table_create(parent);
lv_obj_set_style_bg_color(info.batterytable, lv_color_hex(MAIN_BG_COLOUR), LV_PART_MAIN);
lv_obj_set_style_bg_color(info.batterytable, lv_color_hex(MAIN_BG_COLOUR), LV_PART_ITEMS);
lv_obj_set_style_border_color(info.batterytable, MAIN_BORDER_COLOUR, LV_PART_MAIN);
lv_obj_set_style_border_color(info.batterytable, MAIN_BORDER_COLOUR, LV_PART_ITEMS);
lv_obj_set_style_radius(info.batterytable, 10, 0);
lv_obj_set_style_clip_corner(info.batterytable, true, 0);
/*right then down*/
lv_obj_align_to(info.batterytable, btn_randomFactUpdate, LV_ALIGN_OUT_BOTTOM_LEFT, 10, 40);
lv_obj_set_style_pad_top(info.batterytable, 4, LV_PART_ITEMS);
lv_obj_set_style_pad_bottom(info.batterytable, -4, LV_PART_ITEMS);
lv_table_set_col_cnt(info.batterytable, 2);
static void draw_part_batterytable_event_cb(lv_event_t * e)
{
lv_obj_t * obj = lv_event_get_target(e);
lv_obj_draw_part_dsc_t * dsc = lv_event_get_param(e);
/*If the cells are drawn...*/
if(dsc->part == LV_PART_ITEMS) {
uint32_t row = dsc->id / lv_table_get_col_cnt(obj);
dsc->rect_dsc->bg_color = lv_color_hex(MAIN_BG_COLOUR);
if(row > 0) {
dsc->label_dsc->font = &lv_font_montserrat_18;
//dsc->label_dsc->pad_bottom = -8;
}
}
}
Screenshot and/or video
If possible, add screenshots and/or videos about the current state.
Thanks all