Description
I want to use LV_EVENT_GESTURE event,But it is not responding,I set a breakpoint at “AboutVehicle_event_cb”,When I swipe the screen and the AboutVehicle_event_cb not called.
Is there something wrong with my code?
What MCU/Processor/Board and compiler are you using?
Simulator on PC
What LVGL version are you using?
V8.0
This is my code
static void AboutVehicle_event_cb(lv_event_t* e)
{
lv_obj_t* target = lv_event_get_target(e);
lv_event_code_t code = lv_event_get_code(e);
if (code == LV_EVENT_CLICKED)
{
// lv_obj_del(lv_obj_get_parent(target));
}
else if (code == LV_EVENT_GESTURE)
{
if (lv_indev_get_gesture_dir(lv_indev_get_act()) == LV_DIR_LEFT)
{
lv_obj_del(target);
}
}
}
lv_obj_t* scr1 = lv_obj_create(lv_scr_act());
lv_obj_set_size(scr1,640,480);
lv_obj_set_style_pad_all(scr1, 0, 0);
lv_obj_set_style_pad_bottom(scr1, 20, 0);
lv_obj_set_style_bg_color(scr1, (lv_color_t)LV_COLOR_MAKE(0x1C, 0x18, 0x18), 0);
lv_obj_add_event_cb(scr1, AboutVehicle_event_cb, LV_EVENT_GESTURE, NULL);