Hi, I got a new question!
I want to change the color on the left and right sides of this slider, but I don’t know how to set the style. I tried a lot, but it didn’t work!
How to do this?
My bad try!
Slider color change try
Hi, I got a new question!
I want to change the color on the left and right sides of this slider, but I don’t know how to set the style. I tried a lot, but it didn’t work!
How to do this?
My bad try!
Slider color change try
Change lv.slider.PART.BG
.
style = lv.style_t()
style.init()
style.set_bg_color(lv.STATE.DEFAULT, lv.color_hex(0x0000ff))
style.set_bg_color(lv.STATE.DEFAULT, lv.color_hex(0xff00ff))
slider.add_style(slider.PART.BG, style)
In fact, we need two style objects to set the colors of slider.PART.BG and slider.PART.INDIC respectively, but I think this should be a bug…
That’s correct. You need one style object per logical “part” of the object. Since BG
and INDIC
are separate logical parts, they each need their own style object.