How to pre-load slider values

I have a screen with 3 sliders, every slider has a Label, showing its value.
How to make so, that when the screen is loaded, the slider to be pre-loaded with values from my code (int), and the labels to show them as well?

Hmm, it’s really not that trivial now. We are thinging about how to make it simpler and easier.

For now, you can do one of these:

  • Set the value manually after calling ui_init(): lv_label_set_value_fmt(ui_Label_1, "%d", lv_slider_get_value(ui_Slider1))
  • Set a VALUE CHANGE event for the slider in which you se the label’s text to the slider’s value and after ui_init() send an VALUE CHANGE to the slider. lv_event_send(ui_Slider_1, LV_EVENT_VALUE_CHANGED, NULL);
  • Simply set the label’s text manually in SLS. E.g if the initial value of the slider is 25, just set “25” for the label.

Yeah, usually people will want the sliders to show their values upon load, instead the values in SLS.

I agree, and we will figure out something for this.