记录一下。
用gui_guider做了一个三级菜单的界面,我没有触摸屏幕,用的是物理按键控制菜单,进入二级界面后返回一级界面时候焦点自动聚焦的是第一个btn,实际需要返回进入时的焦点。
切换界面的话我理解是要先把旧的页面删除掉,再显示新的,不然容易引起内存问题,所有我后面还傻乎乎的没发现问题。下面是界面切换的函数,我就不过多解释。
void ui_load_scr_animation(lv_ui *ui, lv_obj_t ** new_scr, bool new_scr_del, bool * old_scr_del, ui_setup_scr_t setup_scr,
lv_scr_load_anim_t anim_type, uint32_t time, uint32_t delay, bool is_clean, bool auto_del)
{
lv_obj_t * act_scr = lv_scr_act();
lv_disp_t * d = lv_obj_get_disp(act_scr);
if (d->prev_scr == NULL && (d->scr_to_load == NULL || d->scr_to_load == act_scr)) {
#if LV_USE_FREEMASTER
if(auto_del) {
gg_edata_task_clear(act_scr);
}
#endif
if (auto_del && is_clean) {
lv_obj_clean(act_scr);
}
if (new_scr_del) {
setup_scr(ui);
}
lv_scr_load_anim(*new_scr, anim_type, time, delay,