创建3x3的grid
static void lv_example_grid_1(void)
{
static lv_coord_t col_dsc[] = { 70, 70, 70, LV_GRID_TEMPLATE_LAST }; // column占三格每个grid的宽度
static lv_coord_t row_dsc[] = { 50, 50, 50, LV_GRID_TEMPLATE_LAST }; // row占三格每个grid的高度
/*Create a container with grid*/
lv_obj_t* cont = lv_obj_create(lv_scr_act()); // 创建obj对象
lv_obj_set_style_grid_column_dsc_array(cont, col_dsc, 0); // 设置column的grid description
lv_obj_set_style_grid_row_dsc_array(cont, row_dsc, 0);// 设置row的grid description
lv_obj_set_size(cont, 300, 220); // 设置大小
lv_obj_center(cont); // 居中显示
lv_obj_set_layout(cont, LV_LAYOUT_GRID); // 设置grid样式
lv_obj_t* label;
lv_obj_t* obj;
uint32_t i;
for (i = 0; i
关注
打赏