Important: posts that do not use this template will be ignored or closed.
Before posting
- Get familiar with Markdown to format and structure your post
- Be sure to update lvgl from the latest version from the
master
branch.- Be sure you have checked the relevant part of the documentation. We will not respond in detail to posts where you haven’t read the relevant documentation.
- If applicable use the Simulator to eliminate hardware related issues.
Delete this section if you read and applied the mentioned points.
Description
When I Slide a little on the page of tabview it can’t return to the original position.I try many ways can,t soulve this problem
What MCU/Processor/Board and compiler are you using?
visual studio
What do you want to achieve?
Deal some problems of plug-ins in lvgl
What have you tried so far?
set the position of tabview’s children as the absolute position
Code to reproduce
Add a code snippet which can run in the simulator. It should contain only the relevant code that compiles without errors when separated from your main code base.
The code block(s) should be formatted like:
/*You code here*/
```static lv_style_t tabviewStyle;
tabview = lv_tabview_create(lv_scr_act(), NULL);
lv_obj_set_size(tabview, LV_HOR_RES, LV_VER_RES);
lv_tabview_set_btns_pos(tabview, LV_TABVIEW_TAB_POS_NONE);
lv_obj_add_style(tabview, LV_OBJ_PART_MAIN, CommonGetDefaultBgStyle());
lv_obj_set_pos(tabview, 0, 0);
tab0 = lv_tabview_add_tab(tabview, "Tab0");
tab1 = lv_tabview_add_tab(tabview, "Tab1");
lv_page_set_scrlbar_mode(tab0, LV_SCRLBAR_MODE_OFF);
lv_page_set_scrlbar_mode(tab1, LV_SCRLBAR_MODE_OFF);
lv_obj_set_event_cb(tabview, tabview_event_handler);
lv_tabview_set_tab_act(tabview, 1, LV_ANIM_OFF);
static lv_style_t rollerbgstyle, rollerselstyle;
lv_style_reset(&rollerselstyle);
lv_style_init(&rollerselstyle);
lv_style_set_bg_color(&rollerselstyle, LV_STATE_DEFAULT, LV_COLOR_BLACK);
lv_style_set_radius(&rollerselstyle, LV_STATE_DEFAULT, 1);
lv_style_set_bg_opa(&rollerselstyle, LV_STATE_DEFAULT, LV_OPA_0);
lv_style_set_text_color(&rollerselstyle, LV_STATE_DEFAULT, LV_COLOR_MAKE(0x00, 0xd8, 0xff));
/*roller backgroud style set*/
lv_style_reset(&rollerbgstyle);
lv_style_init(&rollerbgstyle);
lv_style_set_bg_color(&rollerbgstyle, LV_STATE_DEFAULT, LV_COLOR_BLACK);
lv_style_set_bg_opa(&rollerbgstyle, LV_STATE_DEFAULT, LV_OPA_100);
lv_style_set_radius(&rollerbgstyle, LV_STATE_DEFAULT, 12);
lv_style_set_text_font(&rollerbgstyle, LV_STATE_DEFAULT, &Alibaba_PuHuiTi_M_Alarm30px);
lv_style_set_text_opa(&rollerbgstyle, LV_STATE_DEFAULT, LV_OPA_100);
lv_style_set_text_line_space(&rollerbgstyle, LV_STATE_DEFAULT, 42);
lv_style_set_text_color(&rollerbgstyle, LV_STATE_DEFAULT, LV_COLOR_GRAY);
addtimeroller[HOUR] = lv_roller_create(tab1, NULL);
lv_obj_add_style(edittimeroller[HOUR], LV_ROLLER_PART_BG, &rollerbgstyle);
lv_obj_add_style(edittimeroller[HOUR], LV_ROLLER_PART_SELECTED, &rollerselstyle);
lv_roller_set_options(addtimeroller[HOUR], HourBuf, LV_ROLLER_MODE_INIFINITE);
lv_roller_set_visible_row_count(addtimeroller[HOUR], 3);
lv_obj_set_event_cb(addtimeroller[HOUR], addalarmselect_event_handler);
lv_obj_set_pos(addtimeroller[HOUR], 76, 68);
## Screenshot and/or video
If possible, add screenshots and/or videos about the current state. 