可能带有透明颜色的tizen本机按钮?

问题描述 投票:0回答:1

我想在按钮上设置图像,并将其背景色设置为透明。我们可以显示具有默认颜色的按钮并在其上设置一个图标,但是当我将颜色alpha值设置为零或更少时,所有内容都变为透明。我需要至少在按钮上显示图像。

那么,如何使用代码设置透明背景?

其他所有具有EDC编辑器或EDC代码的解决方案,新的Tizen 5.5不支持。

代码:

Evas_Object *box = elm_box_add(ad->win);
evas_object_size_hint_weight_set(box, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
elm_object_content_set(ad->conform,box);
evas_object_show(box);

ad->button = elm_button_add(ad->conform);
evas_object_size_hint_weight_set(ad->button,0.0,1.0);
evas_object_size_hint_align_set(ad->button,-1.0,1.0);
elm_object_text_set(ad->button,"");
evas_object_color_set(ad->button, 255, 100, 100, 250); //any transparency?
evas_object_show(ad->button);
elm_box_pack_end(box,ad->button);

Evas_Object *ic;
ic = elm_icon_add(ad->button);
elm_image_file_set(ic,ICON_DIR"/ok.png",NULL);
elm_object_part_content_set(ad->button,"icon",ic);
evas_object_show(ic);
tizen tizen-wearable-sdk
1个回答
0
投票

当前没有API可以仅更改按钮背景色。

如果您将click事件与elm_image一起使用,我认为您可以创建所需的内容。

([https://developer.tizen.org/ko/development/guides/native-application/user-interface/efl/ui-components/wearable-ui-components/image

希望对您有帮助。

© www.soinside.com 2019 - 2024. All rights reserved.