当前位置:网站首页>LVGL 8.2 Span
LVGL 8.2 Span
2022-07-25 04:17:00 【Fairy sword love】
Span with custom styles
/** * Create span. */
static void lv_example_span_1(void)
{
static lv_style_t style;
lv_style_init(&style);
lv_style_set_border_width(&style, 1);
lv_style_set_border_color(&style, lv_palette_main(LV_PALETTE_ORANGE));
lv_style_set_pad_all(&style, 2);
lv_obj_t* spans = lv_spangroup_create(lv_scr_act());
lv_obj_set_width(spans, 300);
lv_obj_set_height(spans, 300);
lv_obj_center(spans);
lv_obj_add_style(spans, &style, 0);
lv_spangroup_set_align(spans, LV_TEXT_ALIGN_LEFT);
lv_spangroup_set_overflow(spans, LV_SPAN_OVERFLOW_CLIP);
lv_spangroup_set_indent(spans, 20);
lv_spangroup_set_mode(spans, LV_SPAN_MODE_BREAK);
lv_span_t* span = lv_spangroup_new_span(spans);
lv_span_set_text(span, "China is a beautiful country.");
lv_style_set_text_color(&span->style, lv_palette_main(LV_PALETTE_RED));
lv_style_set_text_decor(&span->style, LV_TEXT_DECOR_STRIKETHROUGH | LV_TEXT_DECOR_UNDERLINE);
lv_style_set_text_opa(&span->style, LV_OPA_50);
span = lv_spangroup_new_span(spans);
lv_span_set_text_static(span, "good good study, day day up.");
#if LV_FONT_MONTSERRAT_24
lv_style_set_text_font(&span->style, &lv_font_montserrat_24);
#endif
lv_style_set_text_color(&span->style, lv_palette_main(LV_PALETTE_GREEN));
span = lv_spangroup_new_span(spans);
lv_span_set_text_static(span, "LVGL is an open-source graphics library.");
lv_style_set_text_color(&span->style, lv_palette_main(LV_PALETTE_BLUE));
span = lv_spangroup_new_span(spans);
lv_span_set_text_static(span, "the boy no name.");
lv_style_set_text_color(&span->style, lv_palette_main(LV_PALETTE_GREEN));
#if LV_FONT_MONTSERRAT_20
lv_style_set_text_font(&span->style, &lv_font_montserrat_20);
#endif
lv_style_set_text_decor(&span->style, LV_TEXT_DECOR_UNDERLINE);
span = lv_spangroup_new_span(spans);
lv_span_set_text(span, "I have a dream that hope to come true.");
lv_spangroup_refr_mode(spans);
}
- Running effect

边栏推荐
- How to do a good job in safety development?
- CVPR 2022 | content aware text logo image generation method
- Win11 experience
- Customized view considerations
- You are only one SQL statement away from the tdengine Developer Conference!
- In the process of data migration from Oracle to polardb for PostgreSQL, what does data migration mean?
- The difference between apply, call and bind
- DNS domain name resolution
- How to use ide tool hhdbcs to create a data table containing 1000 simulated data in Oracle database, and
- Optimize bubble sorting
猜你喜欢

Preparation for Android development in big companies

Uniapp picker select the effect demo of provinces and cities (finishing)

ES (8.1) certification topic

Localization distillation for dense object detection cvpr2022

Implementation of logistics repair reporting system based on SSM

Analytic hierarchy process of MATLAB

You are only one SQL statement away from the tdengine Developer Conference!

C language file operation

How to test cookies

ES(8.1)认证题目
随机推荐
Do you really understand images? (machine vision)
Press the switch for the minimum number of times to turn on all lights
Interview question 05.06. integer conversion
Analytic hierarchy process of MATLAB
Student thinking vs workplace thinking
Aggregate payment meets the needs of various industries to access a variety of payments
Implementation of some basic operation codes of string
The sixth day of brushing questions with force deduction
Wechat applet authorized login (including obtaining basic information and binding mobile number)
Wechat applet access wechat payment process
基于ABP实现DDD--领域逻辑和应用逻辑
Interview question 08.07. Permutation and combination of non repeated strings DFS method
Implementing DDD based on ABP -- domain logic and application logic
[interview must brush 101] greedy algorithm, simulation, string
Pytorch deep learning practice lesson 8 importing data
I want to ask you a question. I want to synchronize the database, but I think it is synchronized according to MySQL binlog. If it is a large table, one
Which securities company do retail investors choose for stock speculation? Is it safe to open an account on your mobile phone
JS absolute minimum value of the sum of Huawei od two numbers
ECCV 2022 | rethinking image blending for data enhancement in vision transformers
Server status code