How to remove cursor from lvgl spinbox widget

I’m using a spinbox defined like this:

                     - spinbox:
                            id: spinbox_id
                            align: CENTER
                            text_align: CENTER
                            text_font: arial_24
                            width: 50
                            range_from: 50
                            range_to: 80
                            step: 1
                            rollover: false
                            digits: 2

which works fine, except the last digit of the setting has a cursor overlaid on it, like in the example shown in the documentation:
image
I’d like to remove the cursor, and found a recommendation for this in bare metal lvgl code:

lv_obj_set_style_local_border_opa(ta, LV_TEXTAREA_PART_CURSOR, LV_STATE_DEFAULT, 0);

but I’m not sure how to translate this to yaml.

Style the cursor part of your spinbox as required. Something like:

    - spinbox:
        cursor:
          bg_opa: transp

Exactly what styles you need to apply you can experiment with.

1 Like

Thanks. I also needed to add opa: transp, but it works great now.

1 Like