Move the List one step down or up in lvgl8.2

Description

What MCU/Processor/Board and compiler are you using?

STM32F407,LVGL8.2,NXP GUIDER

What do you want to achieve?

Move the List one step down or up in lvgl8.2, as in previous versions of lv_list_down(List);
1721629142008

What have you tried so far?

lv_obj_clear_flag(ui->screen_test_disp_list_1_item2, LV_OBJ_FLAG_SCROLL_ON_FOCUS);
lv_group_focus_obj(ui->screen_test_disp_list_1_item2);

#include "lvgl.h"
#include <stdio.h>
#include "gui_guider.h"
#include "events_init.h"
#include "widgets_init.h"
#include "custom.h"

void setup_scr_screen_test_disp(lv_ui *ui)
{
	//Write codes screen_test_disp
	ui->screen_test_disp = lv_obj_create(NULL);
	lv_obj_set_size(ui->screen_test_disp, 320, 240);
	lv_obj_set_scrollbar_mode(ui->screen_test_disp, LV_SCROLLBAR_MODE_OFF);

	//Write style for screen_test_disp, Part: LV_PART_MAIN, State: LV_STATE_DEFAULT.
	lv_obj_set_style_bg_opa(ui->screen_test_disp, 255, LV_PART_MAIN|LV_STATE_DEFAULT);
	lv_obj_set_style_bg_color(ui->screen_test_disp, lv_color_hex(0xffffff), LV_PART_MAIN|LV_STATE_DEFAULT);
	lv_obj_set_style_bg_grad_dir(ui->screen_test_disp, LV_GRAD_DIR_NONE, LV_PART_MAIN|LV_STATE_DEFAULT);

	//Write codes screen_test_disp_list_1
	ui->screen_test_disp_list_1 = lv_list_create(ui->screen_test_disp);
	ui->screen_test_disp_list_1_item0 = lv_list_add_btn(ui->screen_test_disp_list_1, LV_SYMBOL_SAVE, "save");
	ui->screen_test_disp_list_1_item1 = lv_list_add_btn(ui->screen_test_disp_list_1, LV_SYMBOL_SAVE, "save_1");
	ui->screen_test_disp_list_1_item2 = lv_list_add_btn(ui->screen_test_disp_list_1, LV_SYMBOL_SAVE, "save_2");
	ui->screen_test_disp_list_1_item3 = lv_list_add_btn(ui->screen_test_disp_list_1, LV_SYMBOL_SAVE, "save_3");
	lv_obj_set_pos(ui->screen_test_disp_list_1, 80, 70);
	lv_obj_set_size(ui->screen_test_disp_list_1, 160, 127);
	lv_obj_set_scrollbar_mode(ui->screen_test_disp_list_1, LV_SCROLLBAR_MODE_OFF);

	lv_obj_clear_flag(ui->screen_test_disp_list_1_item2, LV_OBJ_FLAG_SCROLL_ON_FOCUS);
	lv_group_focus_obj(ui->screen_test_disp_list_1_item1);

	//Update current screen layout.
	lv_obj_update_layout(ui->screen_test_disp);
}

image

if you want to use lv_group_focus_obj() you need to create group and add your items into it

I used lv_obj_add_state() to fix this, but I don’t know why lv_group_focus_obj() doesn’t work.

Where did you determine which objects are included in the group? Your group is empty. As I said you need to add objects in group.

I do not have touch input, it seems that the operation is a bit complicated, is it like the following? lv_group_t * g = lv_group_create();
lv_group_add_obj(g,ui->screen_memory_disp_list_1_item0);
lv_group_add_obj(g,ui->screen_memory_disp_list_1_item1);
lv_group_add_obj(g,ui->screen_memory_disp_list_1_item2);
lv_group_add_obj(g,ui->screen_memory_disp_list_1_item3);
lv_group_focus_obj(ui->screen_memory_disp_list_1_item2);

seems to be correct
also you can use

void lv_group_focus_next(lv_group_t * group);
void lv_group_focus_prev(lv_group_t * group);

Thank you for your answer. There are many ways to achieve, just solve the problem; lvgl is good, but I still need to learn more about it.