Text on the list scrolling vertically

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

I created a list on the page, but the text scrolling vertically itself, why and how to solve this problem?

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

What do you want to achieve?

see the video below

What have you tried so far?

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*/

Screenshot and/or video

If possible, add screenshots and/or videos about the current state.

I found the problem,it’s something matters with my font, but why wolud this happening?

Please send a code snippet to reproduce the issue.

static lv_style_t style_sb;
// static lv_style_t style_bg;
static lv_style_t style_rel;
static lv_style_t style_pr;
lv_style_copy(&style_sb, &lv_style_pretty_color);
// lv_style_copy(&style_bg, &lv_style_transp_fit);
lv_style_copy(&style_rel, &lv_style_btn_rel);
lv_style_copy(&style_pr, &lv_style_btn_pr);

style_sb.body.padding.right = 0;
style_sb.body.padding.left = 0;
style_sb.body.padding.inner = 0; //scrollbar之间的间距
style_sb.body.padding.top = 0;
style_sb.body.padding.bottom = 0;
style_sb.body.main_color = LV_COLOR_GRAY;
style_sb.body.grad_color = LV_COLOR_GRAY;

style_rel.body.main_color = LV_COLOR_GRAY;
style_rel.body.grad_color = LV_COLOR_BLACK; //LV_COLOR_BLACK
style_rel.body.border.color = LV_COLOR_BLACK;//LV_COLOR_GRAY
style_rel.body.padding.top = 10; //12
style_rel.body.padding.bottom = 10;//12
style_rel.body.radius = 0;
style_rel.text.font = &TC_JhengHei_R12;

static lv_style_t style_SE;
lv_style_copy(&style_SE, &style_rel);
style_SE.body.main_color = LV_COLOR_GRAY;
style_SE.body.grad_color = LV_COLOR_WHITE; //LV_COLOR_BLACK
style_SE.body.border.color = LV_COLOR_BLACK;//LV_COLOR_GRAY
style_SE.body.padding.top = 12;
style_SE.body.padding.bottom = 12;
style_SE.body.radius = 0;
style_SE.body.opa = LV_OPA_60;
//style_SE.text.font = &TC_JhengHei_R12;
//SecLayer_Set.list_btn_rel_style = style_rel;
// SecLayer_Set.list_btn_seletc_style = style_SE;

lv_obj_t * setting_list = lv_list_create(set_page, NULL); //lv_disp_get_scr_act(NULL)
// lv_obj_align(setting_list, NULL, LV_ALIGN_IN_RIGHT_TOP, 20, 0);
lv_obj_set_pos(setting_list, 0, top_banner_heigth);
//lv_obj_set_size(setting_list, scr_r_length,232);//252
lv_obj_set_width(setting_list,scr_r_length);

lv_list_set_style(setting_list,LV_LIST_STYLE_SCRL,&style_sb);
// lv_list_set_style(setting_list,LV_LIST_STYLE_BG,&style_bg);
lv_list_set_style(setting_list,LV_LIST_STYLE_BTN_REL ,&style_rel);
lv_list_set_style(setting_list,LV_LIST_STYLE_BTN_PR ,&style_pr);

lv_obj_t* st_list_btn;
st_list_btn = lv_list_add_btn(setting_list, LV_SYMBOL_DRIVE, “預置”);//LV_SYMBOL_DRIVE
lv_obj_set_event_cb(st_list_btn, setting_btn_event);
lv_btn_set_style(st_list_btn,LV_BTN_STYLE_REL,&style_SE);
lv_btn_set_style(st_list_btn,LV_BTN_STYLE_PR,&style_SE);
SecLayer_Set.listbtn_highlight = st_list_btn;

lv_obj_t* set_obj;
set_obj = lv_label_create(set_page,NULL);
lv_obj_align(set_obj,st_list_btn,LV_ALIGN_IN_RIGHT_MID,0,0);
lv_label_set_text(set_obj,">");

st_list_btn = lv_list_add_btn(setting_list, LV_SYMBOL_DRIVE, “顯示方式”);
lv_obj_set_event_cb(st_list_btn, setting_listbtn_event);

set_obj = lv_cb_create(set_page,NULL);
lv_obj_align(set_obj,st_list_btn,LV_ALIGN_IN_RIGHT_MID,40,0);
lv_cb_set_text(set_obj,“1”);
lv_obj_set_event_cb(set_obj,CheckBoxEventCb);
SecLayer_Set.list_cb_DisMode = set_obj;

st_list_btn = lv_list_add_btn(setting_list, LV_SYMBOL_DRIVE, “語音開關”);
lv_obj_set_event_cb(st_list_btn, setting_btn_event);

st_list_btn = lv_list_add_btn(setting_list, LV_SYMBOL_DRIVE, “語音音量”);
lv_obj_set_event_cb(st_list_btn, setting_btn_event);

st_list_btn = lv_list_add_btn(setting_list, LV_SYMBOL_DRIVE, “工程模式開關”);
lv_obj_set_event_cb(st_list_btn, setting_btn_event);

st_list_btn = lv_list_add_btn(setting_list, LV_SYMBOL_DRIVE, “波形輸出方式”);
lv_obj_set_event_cb(st_list_btn, setting_btn_event);

The problem is that I used my font “TC_JhengHei_R12”,
Here is my font “.c” file: TC_JhengHei_R12.c (299.5 KB)

There are variables in you example which are not defined.
I’ve replaced them as I could but it work normally for me.

Please send only list with 2 items.

I’m sorry I fotgot delete some undefined variables, and I just tested with 2 itmes on STM-32, it’s OK now, pretty weird. Last time the text words scrolling vertically on my RDA board, I will try again on RDA board.

I tried this time on RDA board as the last time,now the “text scrolling” just gone, not sure what’s the difference as I think I have tested the same codes, anyway thanks for your time for answering.