2407167_en-US

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

2407167_en-US

2407167_en-US

GUIGuider-2.0.0 container object default padding issue

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?

回复: GUIGuider-2.0.0容器对象默认内边距问题

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

回复: GUIGuider-2.0.0容器对象默认内边距问题

Hi @RedFace_caocao 

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


タグ(1)
評価なし
バージョン履歴
最終更新日:
3 週間前
更新者: