Spinner (lv_spinner)¶
Overview¶
The Spinner Widget is a spinning arc over a ring, typically used to show some type of activity is in progress.
Parts and Styles¶
Spinner's parts are identical to those of Arc.
Usage¶
Create a spinner¶
To create a spinner use lv_spinner_create(parent).
Use lv_spinner_set_anim_params(spinner, spin_duration, angle) to customize the duration of one revolution and the length of the arc.
Events¶
No special events are sent by Spinner Widgets.
Keys¶
No Keys are processed by Spinner Widgets.
Further Reading
Learn more about Keys.
Example¶
Simple spinner¶
C code
View on GitHub#include "../../lv_examples.h"
#if LV_USE_SPINNER && LV_BUILD_EXAMPLES
/**
* @title Centered busy spinner
* @brief Place a 100 by 100 spinner on the active screen with custom timing.
*
* A spinner is created on the active screen, sized to 100 by 100,
* centered, and tuned with `lv_spinner_set_anim_params` to a
* 10000 ms loop time and a 200 degree arc length.
*/
void lv_example_spinner_1(void)
{
/*Create a spinner*/
lv_obj_t * spinner = lv_spinner_create(lv_screen_active());
lv_obj_set_size(spinner, 100, 100);
lv_obj_center(spinner);
lv_spinner_set_anim_params(spinner, 10000, 200);
}
#endif