我正在开发一个使用 genlist 来显示信息的 Galaxy Gear S2 应用程序。该应用程序的要求之一是 genlist 应具有橙色背景而不是黑色背景。我一直在使用这个网站作为指导。
我已经更改了窗口的背景,但窗口背景似乎在 genlist 背景后面。这意味着背景颜色仅在窗口之间切换时显示。
genlist 如下所示。
static void create_first_list(appdata_s *ad){
Evas_Object *genlist = NULL;
Evas_Object *naviframe = ad ->naviframe;
Elm_Object_Item *nf_it = NULL;
Elm_Genlist_Item_Class *itc = elm_genlist_item_class_new();
Elm_Genlist_Item_Class *titc = elm_genlist_item_class_new();
Elm_Genlist_Item_Class *pitc = elm_genlist_item_class_new();
item_data *id = NULL;
int index = 0;
local_ad = ad;
genlist = elm_genlist_add(naviframe);
elm_genlist_mode_set(genlist, ELM_LIST_COMPRESS);
evas_object_smart_callback_add(genlist, "selected", NULL, NULL);
ad->circle_genlist = eext_circle_object_genlist_add(genlist, ad->circle_surface);
eext_circle_object_genlist_scroller_policy_set(ad->circle_genlist, ELM_SCROLLER_POLICY_OFF, ELM_SCROLLER_POLICY_AUTO);
eext_rotary_object_event_activated_set(ad->circle_genlist, EINA_TRUE);
itc->item_style = "1text";
itc->func.text_get = _gl_main_text_getfirst;
itc->func.del = _gl_menu_del;
titc->item_style = "title";
titc->func.text_get = _gl_title_text_get;
titc->func.del = _gl_menu_del;
pitc->item_style = "padding";
elm_genlist_item_append(genlist, titc, NULL, NULL, ELM_GENLIST_ITEM_NONE, NULL, ad);
id = calloc(sizeof(item_data), 1);
id->index = index++;
id->item = elm_genlist_item_append(genlist, itc, id, NULL, ELM_GENLIST_ITEM_NONE, btn_cb_connect, ad);
elm_genlist_item_append(genlist, pitc, NULL, NULL, ELM_GENLIST_ITEM_NONE, NULL, ad);
elm_genlist_item_class_free(titc);
elm_genlist_item_class_free(itc);
elm_genlist_item_class_free(pitc);
local_ad->naviframe = naviframe;
nf_it = elm_naviframe_item_push(naviframe, NULL, NULL, NULL, genlist, "empty");
elm_naviframe_item_pop_cb_set(nf_it, _naviframe_pop_cb, ad->win);
}
此 genlist 仅包含一项。我尝试通过在 genlist 生成方法中执行以下操作来更改背景颜色。
elm_bg_color_set(genlist, 255, 168, 0);
这对更改 genlist 的背景不起作用。有没有办法改变整个 genlist 背景?如果是这样,怎么做?