您当前的位置: 首页 > 

仙剑情缘

暂无认证

  • 0浏览

    0关注

    333博文

    0收益

  • 0浏览

    0点赞

    0打赏

    0留言

私信
关注
热门博文

LVGL V8之grid‘s free unit

仙剑情缘 发布时间:2021-08-25 07:28:34 ,浏览量:0

Demonstrate grid’s free unit
static void lv_example_grid_3(void)
{
    /*Column 1: fix width 60 px
    *Column 2: 1 unit from the remaining free space
    *Column 3: 2 unit from the remaining free space*/
    static lv_coord_t col_dsc[] = { 60, LV_GRID_FR(1), LV_GRID_FR(2), LV_GRID_TEMPLATE_LAST };
    /*Row 1: fix width 50 px
    *Row 2: 1 unit from the remaining free space
    *Row 3: fix width 50 px*/
    static lv_coord_t row_dsc[] = { 50, LV_GRID_FR(1), 50, LV_GRID_TEMPLATE_LAST };
    /*Create a container with grid*/
    lv_obj_t* cont = lv_obj_create(lv_scr_act());
    lv_obj_set_size(cont, 300, 220); // 设置大小
    lv_obj_center(cont);   // 居中显示
    lv_obj_set_grid_dsc_array(cont, col_dsc, row_dsc);
    lv_obj_t* label;
    lv_obj_t* obj;
    uint32_t i;
    for (i = 0; i             
关注
打赏
1658017818
查看更多评论
0.7539s