Image Button (lv_imagebutton)

A button that draws per-state images instead of a styled rectangle.

Overview

The Image Button behaves like a Button but draws user-supplied images per state instead of a styled rectangle. Separate left, middle and right images can be set; the middle image is tiled to fill the width.

Learn more in the LVGL Open documentation.

Enumerations

lv_imagebutton_state — Possible states of an image button

ValueDescription
releasedReleased
pressedPressed
disabledDisabled
checked_releasedChecked and released
checked_pressedChecked and pressed
checked_disabledChecked and disabled

Properties

Parts

Style parts of the widget with local style (e.g. style_bg_color-knob="0xff0000") or with style sheets (e.g. <style name="style_knob" selector="knob">). See Styles to learn more.

PartDescription
mainStyle the button: background, text and image_recolor/image_recolor_opa properties. The shown left/mid/right images change with the state (released, pressed, disabled, checked_*).

Properties below are the widget's XML <api>; see API for how properties, parameters and elements work.

PropertyTypeDescription
stateenum:lv_imagebutton_stateThe current state of the imagebutton

<lv_imagebutton-src>

Set the image sources in a given state

access set

NameKindTypeDescription
stateargenum:lv_imagebutton_stateSet the images in this state
leftpropimageThe left image in the given state
midpropimageThe middle image in the given state
rightpropimageThe right image in the given state

Last updated on

On this page