As shown in the picture, when the list_add_btn of the source code is added to button, image/symbol defaults to text. How do I switch their positions?
I think lv_obj_move_foreground(lv_list_get_btn_label(list_btn))
will move the text before the image.
Hi @embeddedt,
Thanks, it works. But I want to put the picture on the far right, so far there’s still a lot of space at the end of the line. Thanks again.
There is no API to easily modify the layout the buttons.
If I were you I did this:
lv_obj_t * list_btn = lv_list_add_btn(list1, LV_SYMBOL_FILE, "New");
lv_btn_set_layout(list_btn, LV_LAYOUT_OFF);
lv_obj_t * img = lv_list_get_btn_img(list_btn);
lv_obj_align(img, NULL, LV_ALIGN_IN_RIGHT_MID, -20, 0);
lv_obj_t * txt = lv_list_get_btn_label(list_btn);
lv_obj_align(txt, NULL, LV_ALIGN_IN_LEFT_MID, 20, 0);