mirror of
https://github.com/lvgl/lvgl.git
synced 2025-01-28 07:03:00 +08:00
parent
05382b95de
commit
b4986ab5dc
@ -18,8 +18,11 @@ The Switch looks like a little slider and can be used to turn something on and o
|
||||
## Usage
|
||||
|
||||
### Change state
|
||||
When the switch is turned on it goes to `LV_STATE_CHECKED`. To get the current satte of the switch use `lv_obj_has_state(switch, LV_STATE_CHECKED)`.
|
||||
To manually turn the switch on/off call `lvobj_add/clear_state(switch, LV_STATE_CHECKED)`.
|
||||
The switch uses the standard `LV_STATE_CHECKED` state.
|
||||
|
||||
To get the current state of the switch (with `true` being on), use `lv_obj_has_state(switch, LV_STATE_CHECKED)`.
|
||||
|
||||
Call `lv_obj_add_state(switch, LV_STATE_CHECKED)` to turn it on, or `lv_obj_clear_state(switch, LV_STATE_CHECKED)` to turn it off.
|
||||
|
||||
|
||||
## Events
|
||||
|
Loading…
x
Reference in New Issue
Block a user