源代码

  //18. 消息弹窗控件
static const char * btns[] = { "Apply", "Close", "" };
mbox1 = lv_mbox_create(lv_scr_act(), NULL);
lv_mbox_set_text(mbox1, "A message box with two buttons.");
lv_mbox_add_btns(mbox1, btns);
lv_obj_set_width(mbox1, 160);
lv_obj_set_event_cb(mbox1, mbox_event_handler);
lv_obj_align(mbox1, NULL, LV_ALIGN_CENTER, -180, 120); /*Align to the corner*/

效果显示

2021-01-20_控件

2021-01-20_控件_02