当前位置:网站首页>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

边栏推荐
- Implementation of online number or fan query of the scene
- Interview question 05.06. integer conversion
- Beijing University of Posts and telecommunications | RIS assisted in-house multi robot communication system joint deep reinforcement learning
- 51 single chip microcomputer measures the period of square wave signal
- Creativity: Modern Art anonymous oil painting AI works presentation
- Es- retrieve the selected field from the search
- MySQL select query part 2
- Numpy overview
- C language: string processing function
- (cvpr2020) reading of learning texture transformer network for image super resolution
猜你喜欢

Servlet personal practice notes (I)

DNS resolution experiment

Bubble mart's market value evaporated by HK $21billion in seven days, which can't be sold in China, and its future at sea is uncertain

Eve-ng lab simulator Cisco, H3C test host alias

Digital collections can go further without hype

C language file operation

DNS domain name resolution service
![Function and technical principle of data desensitization [detailed explanation]](/img/bb/5890d8fd140982ea7b994942093cc7.png)
Function and technical principle of data desensitization [detailed explanation]

Maker concept design to adapt to popular education

Application of AI in testing
随机推荐
Creativity: Modern Art anonymous oil painting AI works presentation
DNS resolution experiment
应急响应全栈
[understanding of opportunity-47]: Guiguzi - Chapter 11 - decision makers, moderation, and rational distribution of interests
226. Flip binary tree DFS method
Customized view considerations
DIY can decorate the mall system, you can also have!
考研经历
基于ABP实现DDD--领域逻辑和应用逻辑
Behind Senma's LP, "Wenzhou Department" is running into the venture capital circle
Definition and basic terms of tree
Cluster clock synchronization configuration
Huawei | mlgoperf: ML boot inline for optimizing performance
Jenkins continues to integrate entry to mastery
One question per day
Memory leak due to improper handling of custom view
word怎么取消退出修订模式
Shell programming (script) (variable)
Source code analysis of ArrayList
Top101 [linked list] must be applied for interview