LVGL colors display background

I am puzzeled with the output of my code
It should cover the whole screen but I get this white are on the top
LVGL 8.3.8 on ESP32 dev kit

include <lvgl.h>
#include <TFT_eSPI.h>
#include “touch.h”

static const uint16_t screenWidth = 480;
static const uint16_t screenHeight = 320;
static lv_disp_draw_buf_t disp_buf;
static lv_color_t buf[screenWidth*20];

TFT_eSPI tft = TFT_eSPI();

/* Display flushing */
void my_disp_flush(lv_disp_drv_t *disp, const lv_area_t *area, lv_color_t *color_p)
uint32_t w = (area->x2 - area->x1 + 1);
uint32_t h = (area->y2 - area->y1 + 1);

tft.setAddrWindow(area->x1, area->y1,  w, h);
tft.pushColors((uint16_t *)&color_p->full, w*h, true);

/*Change the active screen's background color*/
lv_obj_set_style_bg_color(lv_scr_act(), lv_color_hex(0x1f272a), LV_PART_MAIN);



void setup()
Serial.begin(115200); /* prepare for possible serial debug */


touch_init(tft.width(), tft.height(),tft.getRotation());

lv_disp_draw_buf_init(&disp_buf, buf, NULL, screenWidth*20);

/*Initialize the display*/
static lv_disp_drv_t disp_drv;
disp_drv.hor_res = tft.width();
disp_drv.ver_res = tft.height();
disp_drv.flush_cb = my_disp_flush;
disp_drv.draw_buf = &disp_buf;


void loop()

lv_task_handler(); /* let the GUI do its work */


Anybody can help?

Can you show me your LCD parameters and lv_conf.h file? Maybe they are not compatible, try editing COLOR SETTINGS and MEMORY SETTINGS

Can you try to add

/Change the active screen’s background color/
lv_obj_set_style_bg_color(lv_scr_act(), lv_color_hex(0x1f272a), LV_PART_MAIN);

this line at the setup function, after the


line instead of calling it in the flush function?

Thank you