First, I created a container, then added an image as a child object inside it, with the image object positioned at 0,0. However, during UI editing, there were blank areas on the left and top. After analysis, I found that this was caused by the container object having default padding. I need to explicitly set the container object's padding to 0 to solve this problem. This is too cumbersome; is there a better solution?
Hi @RedFace_caocao ,
The default styles of the components in GUI Guider V2 follow the styles in the default theme of LVGL, and no additional styles are maintained.
Thank you for your feedback. We will carefully consider optimizing this aspect in future versions.
Best Regards,
Wenbin
You can add
lv_obj_set_style_pad_all(ui->screen.container_1,0, LV_PART_MAIN | LV_STATE_DEFAULT);
to Remove default padding.
the sample code is
// Create container: ui->screen.container_1
ui->screen.container_1 = lv_obj_create(ui->screen.screen);
lv_obj_set_style_pad_all(ui->screen.container_1,0, LV_PART_MAIN | LV_STATE_DEFAULT);
lv_obj_set_width(ui->screen.container_1, 200);
lv_obj_set_height(ui->screen.container_1, 150);
lv_obj_set_align(ui->screen.container_1, LV_ALIGN_TOP_LEFT);
lv_obj_set_x(ui->screen.container_1, 0);
lv_obj_set_y(ui->screen.container_1, 0);
BR
Harry