Excuse yourself again …
I have some problems with porting …
I have a container with a grid layout that after the port does not align the buttons anymore. They are surmounted
My code is:
static void HeaderTableCreate ( lv_obj_t * container )
{
lv_obj_t *cont = lv_page_get_scrl( container );
lv_cont_set_layout( cont, LV_LAYOUT_GRID );
lv_page_set_style( container, LV_PAGE_STYLE_SCRL, getstylelgldefault( ) );
lv_coord_t lbl_w1 = ( ( ( lv_obj_get_width( container ) - 10 ) / NUMBEROFTABLECOLUMN ) - getstylelgldefault( )->body.padding.inner * 2 );
for( uint8_t col = 0; col < NUMBEROFTABLECOLUMN; col++ ){
btnhd[col] = lv_btn_create( container, NULL );
lv_obj_set_user_data( btnhd[col], col );
lv_obj_set_size( btnhd[col], lbl_w1, 30 );
lv_page_glue_obj( btnhd[col], true );
lv_obj_set_event_cb( btnhd[col], btnheader_click );
if( col == 0 )
{
lv_btn_set_style( btnhd[col], LV_BTN_STYLE_REL, getstylelglwhite( ) );
lv_btn_set_style( btnhd[col], LV_BTN_STYLE_PR, getstylelglwhite( ) );
}
else
{
lv_btn_set_style( btnhd[col], LV_BTN_STYLE_REL, getstylelglheadertable( ) );
lv_btn_set_style( btnhd[col], LV_BTN_STYLE_PR, getstylelglbtnpr( ) );
}
btnhdtxt[col] = lv_label_create( btnhd[col], NULL );
lv_label_set_long_mode(btnhdtxt[col], LV_LABEL_LONG_SROLL); /*Break the long lines*/
lv_obj_set_width(btnhdtxt[col], ( lbl_w1 - 10 ) );
}
}
Some idea?
Thank you very much
Walter