How to keep the button sytle even if I release the button in the button matrix?


I create a button matrix, and it has 5 buttons. Also I create 3 sytles for button: style_bg, style_rel, style_pr, I don’t know how to achive the effect as I uploaded. If I clicked a button(sure ,it released), it shows a green background,

What MCU/Processor/Board and compiler are you using?

What do you want to achieve?

when I clicked a botton in the button matrix, I prefer to show a white button background and the color of text is green, even I released the button.

What have you tried so far?

Code to reproduce

Add a code snippet which can run in the simulator. It should contain only the relevant code that compiles without errors when separated from your main code base.

The code block(s) should be formatted like:

/*You code here*/

Screenshot and/or video

i solved my problem.

To help others can you write how did you solve the problem?

1 Like

ok.first you should add function “lv_btnm_set_btn_ctrl_all();” and “lv_btnm_set_one_toggle”, then you should notice your button style, especially the LV_BTNM_SYLYE_BTN_TGL_REL,then you will get what you want.

Just a friendly word of advice: this information will not be very useful to future readers. It would be better to provide a code sample before and after and illustrate exactly what the change does.