About tabview widget

How to disable sliding TAB inTabView?

My code is as follows, but it is invalid

    tv1 = lv_tabview_create(obj_operation_win,NULL);
    lv_obj_add_style(tv1,LV_TABVIEW_PART_BG,&tv_style);

    lv_obj_set_size(tv1,LV_HOR_RES_MAX,LV_VER_RES_MAX);
    lv_obj_set_style_local_pad_right(tv1, LV_TABVIEW_PART_TAB_BG, LV_STATE_DEFAULT, LV_HOR_RES / 2);





    tab1 = lv_tabview_add_tab(tv1, language_list_char[30][ui_parment.select_language]);
    tab2 = lv_tabview_add_tab(tv1, language_list_char[31][ui_parment.select_language]);
    tab3 = lv_tabview_add_tab(tv1, language_list_char[32][ui_parment.select_language]);



    lv_obj_set_drag(tv1,false);




    lv_obj_set_drag(tab1,false);
    lv_obj_set_drag(tab2,false);
    lv_obj_set_drag(tab3,false);

    lv_obj_set_drag_throw(tab1,false);
    lv_obj_set_drag_throw(tab2,false);
    lv_obj_set_drag_throw(tab3,false);

version in release 7

You can try lv_page_set_scroll_propagation(tab1/tab2/tab3, true) (based on this docs page).

1 Like
  • Thank you very much for the tip,It helps me a lot.