Cover question,how to do

I have a question:
first,I create an arc( lv_arc_create(lv_scr_act() ).
then,I create an page( lv_page_create(lv_scr_act() ).
in this case,page will cover arc. But I don’t want to be covered,because if i move the arc to top,the page will do not slide.What should I do?

Hi @guoweilkd,

Are you wanting the arc to be on the page?

If so you need to create the page first and use it’s handle as the parent to create the arc.

Something along these lines…

/*Create a page*/
lv_obj_t * page = lv_page_create(lv_scr_act(), NULL);
lv_obj_set_size(page, 300, 300);
lv_obj_align(page, NULL, LV_ALIGN_CENTER, 0, 0);

/*Create an arc on the page*/
lv_obj_t * arc = lv_arc_create(page, NULL);
lv_arc_set_end_angle(arc, 200);
lv_obj_set_size(arc, 150, 150);
lv_obj_align(arc, NULL, LV_ALIGN_CENTER, 0, 0);

Hope that helps,

Kind Regards,

Pete

in this case, the page will can not slide?

Hi @guoweilkd,

Is it possible you can provide a bit more information about what you are trying to achieve please?

Are you wanting perhaps to have a tab view with multiple pages which can be changed by sliding?

Kind Regards,

Pete

The page is on top of the arc because objects created last are drawn with the highest z-index (i.e. on top of other objects). You should create the page first if you want the arc to be visible.

Then, if you want the arc to scroll with the page, the arc needs to be a child of the page (pass page to lv_arc_create instead of lv_scr_act()). If you don’t want the arc to scroll with the page, you should just create it on top of the page.