Display a white backround for box widget?

Display a white backround for box widget?

BY 30 Mar 2016 Native Application Development

I’m currently stuck with the problem that all default example UI’s do not have the white background. My UI don’t have is too. I was trying to figure it out whole evening, and now I beg the community for help. I’m using layout just like in EmailUI example to get the navigation bar drawer. I want to populate the naviframe with the mainpage object, which is created with this function below:

static Evas_Object*
create_mainpage(appdata_s *ad) {
    Evas_Object* mainpage_box;
	Evas_Object* item_header;
	mainpage_box = elm_box_add(ad->nf);
	elm_box_align_set(mainpage_box, 0, 0);
	evas_object_size_hint_weight_set(mainpage_box, EVAS_HINT_FILL, EVAS_HINT_FILL);
	evas_object_size_hint_align_set(mainpage_box, EVAS_HINT_FILL, EVAS_HINT_FILL);
	evas_object_show(mainpage_box);

	//try to add bg
	Evas_Object* bg = elm_bg_add(mainpage_box);
	evas_object_size_hint_weight_set(bg, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
	elm_win_resize_object_add(mainpage_box, bg);
	elm_bg_color_set(bg, 0, 0, 0);
	evas_object_show(bg);
	elm_box_pack_end(mainpage_box, bg);

	// add headers
	item_header = create_item_header(mainpage_box, "<font_size=30>Подборка 1</font_size>");
	evas_object_show(item_header);
	elm_box_pack_end(mainpage_box, item_header);

	item_header = create_item_header(mainpage_box, "<font_size=30>Подборка 2</font_size>");
	evas_object_show(item_header);
	elm_box_pack_end(mainpage_box, item_header);

	return bg;
}

I tried to make bg a child of mainpage_box and vice versa. code listed above is producing this result (delete the spaces, tizen forums doesn’t allow any links):

https: //i.gyazo.com /c05b5e57b7e19ccf4d7ae75f95074265.png

the code listed below producing this:

https: //i.gyazo.com /5036d407d836fdf66479c56912460f11.png

static Evas_Object*
create_mainpage(appdata_s *ad) {
    Evas_Object* mainpage_box;
	Evas_Object* item_header;

	Evas_Object* bg = elm_bg_add(ad->nf);
	evas_object_size_hint_weight_set(bg, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
	elm_win_resize_object_add(ad->nf, bg);
	elm_bg_color_set(bg, 200, 0, 0);
	evas_object_show(bg);

	mainpage_box = elm_box_add(bg);
	elm_box_align_set(mainpage_box, 0, 0);
	evas_object_size_hint_weight_set(mainpage_box, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
	evas_object_size_hint_align_set(mainpage_box, EVAS_HINT_FILL, EVAS_HINT_FILL);
	evas_object_show(mainpage_box);
	//try to add bg

	// add headers
	item_header = create_item_header(mainpage_box, "<font_size=30>Подборка 1</font_size>");
	evas_object_show(item_header);
	elm_box_pack_end(mainpage_box, item_header);

	item_header = create_item_header(mainpage_box, "<font_size=30>Подборка 2</font_size>");
	evas_object_show(item_header);
	elm_box_pack_end(mainpage_box, item_header);

	return bg;
}

It is closer to what I want, but labels are located on top of indicator, which is nonacceptable. How can i improve my situation?

Written by