if (child_y_center == cont_y_center)
{
/* 当前显示界面的索引 */
lv_coord_t current_btn_index = lv_obj_get_index(child);
/* 判断界面移动的数数据,并将当前界面的索引改为中间位置 */
/* 因为是在滑动结束后实现的,建议界面较多的情况下使用此方式,当界面较少,一次滑动太多界面时,容易滑倒边界出现卡顿现象 */
lv_coord_t move_btn_quantity = LV_ABS(current_btn_index - mid_btn_index);
eLIBs_printf("move_btn_quantity%d\n", lv_obj_is_scrolling(cont));
flag_scroll_a = 1;
for (lv_coord_t j = 0; j < move_btn_quantity; j++)
{
/* 向右滑动 */
if (current_btn_index < mid_btn_index)
{
lv_obj_move_to_index(lv_obj_get_child(cont, child_cnt - 1), 0); // 将最后一个界面索引改为第一个界面
lv_obj_scroll_to_view(lv_obj_get_child(cont, mid_btn_index), LV_ANIM_OFF); // lv_obj_get_child 通过子索引获取对象的子对象
}
/* 向左滑动 */
if (current_btn_index > mid_btn_index)
{
lv_obj_move_to_index(lv_obj_get_child(cont, 0), child_cnt - 1); // 将第一个界面的索引值改为最后一个界面
lv_obj_scroll_to_view(lv_obj_get_child(cont, mid_btn_index), LV_ANIM_OFF); // lv_obj_get_child 通过子索引获取对象的子对象
}
}