Span

Report on GitHub

Rich text container where each lv_span_t segment can carry its own style, enabling mixed formatting within one paragraph.

Styled spans with click hit-test

Stack multiple styled spans in one group and log the clicked segment.

A centered lv_spangroup of width 300 and LV_SIZE_CONTENT height is styled with an orange 1 px border and 20 px indent, and uses LV_SPAN_OVERFLOW_CLIP. Five spans add text with per-segment color, LV_TEXT_DECOR_UNDERLINE, LV_TEXT_DECOR_STRIKETHROUGH, reduced opacity, and alternate fonts. A LV_EVENT_CLICKED handler resolves the clicked point to a span via lv_spangroup_get_span_by_point and logs its text.

How is this guide?

Last updated on

On this page