Hello,
We use lvgl v7.0 to create one button with keypad controller. we hope the button can’t be seen by user. So we set the button focused border width as 0 and OPA as 0.
static lv_style_t style_screen_info_btnMenu_main_focused;
lv_style_reset(&style_screen_info_btnMenu_main_focused);
lv_style_set_text_color(&style_screen_info_btnMenu_main_focused, LV_STATE_FOCUSED, lv_color_hex(0xFF0000));
lv_style_set_text_font(&style_screen_info_btnMenu_main_focused, LV_STATE_FOCUSED, &lv_font_montserrat_12);
lv_style_set_bg_opa(&style_screen_info_btnMenu_main_focused, LV_STATE_FOCUSED, 0);
lv_style_set_border_width(&style_screen_info_btnMenu_main_focused, LV_STATE_FOCUSED, 0);
lv_style_set_border_opa(&style_screen_info_btnMenu_main_focused, LV_STATE_FOCUSED, 0);
lv_style_set_border_color(&style_screen_info_btnMenu_main_focused, LV_STATE_FOCUSED, lv_color_hex(0x000000));
lv_style_set_radius(&style_screen_info_btnMenu_main_focused, LV_STATE_FOCUSED, 50);
lv_style_set_shadow_width(&style_screen_info_btnMenu_main_focused, LV_STATE_FOCUSED, 0);
lv_obj_add_style(ui->screen_info_btnMenu, LV_BTN_PART_MAIN, &style_screen_info_btnMenu_main_focused);
It is ok to hidden and user can’t see it before added into lv_group_t. But we can see the button border width is set to 2 and color as red after added into group for responding keypad.
lv_obj_set_event_cb(ui->screen_info_btnMenu, screen_info_btnMenu_event_handler);
lv_group_add_obj(pKeyGroup, ui->screen_info_btnMenu);
how to change the button focused border color and width after added into group? thanks.