So I’m simply trying to add various widget into a lv_const container.
The widgets are added, but the do not respect the offset I set on Y, so they end up all together.
I tryed various option, and the best I had was with LV_LAYOUT_PRETTY_MID enable.
So here the various questions
- Is lv_obj_align() is ignored when the obj is a child ?
- lv_label_set_long_mode(), is ignored when the obj is a child ?
_lvglBaseView = lv_cont_create(lv_scr_act(),0);
lv_obj_add_style(_lvglBaseView, LV_OBJ_PART_MAIN, &style_screen); //turn the screen white
lv_obj_set_pos(_lvglBaseView,0,BANDEAU_SYS_Y);
lv_obj_set_size(_lvglBaseView, 320, 480-BANDEAU_SYS_Y);
// lv_cont_set_layout(_lvglBaseView, LV_LAYOUT_PRETTY_MID);
//lv_obj_set_auto_realign(_lvglBaseView, true);
//lv_obj_align_origo(_lvglBaseView, NULL, LV_ALIGN_IN_TOP_LEFT, 0, BANDEAU_SYS_Y); /*This parametrs will be sued when realigned*/
//lv_cont_set_fit(_lvglBaseView, LV_FIT_PARENT);
if(_title){
_titleWidget = lv_label_create(_lvglBaseView, 0);
lv_label_set_static_text(_titleWidget, _title);
lv_label_set_align(_titleWidget,LV_LABEL_ALIGN_CENTER);
lv_label_set_long_mode(_titleWidget,LV_LABEL_LONG_SROLL);
lv_obj_align(_titleWidget, _lvglBaseView, LV_ALIGN_OUT_TOP_MID, 0, 30);
}
if(_serviceLabel){
_serviceLabelWidget = lv_label_create(_lvglBaseView, 0);
lv_label_set_static_text(_serviceLabelWidget, _serviceLabel);
lv_label_set_align(_serviceLabelWidget,LV_LABEL_ALIGN_CENTER);
lv_label_set_long_mode(_serviceLabelWidget,LV_LABEL_LONG_BREAK);
lv_obj_align(_serviceLabelWidget, _lvglBaseView, LV_ALIGN_OUT_TOP_MID, 0, 90);
}
if(_descLabel){
_descLabelWidget = lv_label_create(_lvglBaseView, 0);
lv_label_set_static_text(_descLabelWidget, _descLabel);
lv_label_set_align(_descLabelWidget,LV_LABEL_ALIGN_CENTER);
lv_label_set_long_mode(_descLabelWidget,LV_LABEL_LONG_BREAK);
lv_obj_align(_descLabelWidget, _lvglBaseView, LV_ALIGN_OUT_TOP_MID, 0, 120);
}
_inputWidget = lv_textarea_create(_lvglBaseView, 0);
lv_textarea_set_text(_inputWidget, defaultInput);
lv_textarea_set_text_align(_inputWidget,LV_LABEL_ALIGN_CENTER);
lv_obj_set_size(_inputWidget, 200, 50);
lv_obj_align(_inputWidget, _lvglBaseView, LV_ALIGN_OUT_TOP_MID, 0, 200);!