1
0
mirror of https://github.com/lvgl/lvgl.git synced 2025-01-28 07:03:00 +08:00

docs(switch) improve wording

Fixes #2927
This commit is contained in:
embeddedt 2022-01-04 21:38:15 -05:00 committed by GitHub
parent 05382b95de
commit b4986ab5dc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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