语言

Menu
Sites
Language
[Solved] UI Builder Widget Background

I am building a widget with the UI Builder. It appears the background defaults to black. I would like to set the background to transparent. How should I do this?

When the view is created, I have tried the following but it does not seem to work.

void MainView_onuib_view_create(uib_MainView_view_context *vc, Evas_Object *obj, void *event_info)
{
    elm_win_alpha_set(vc->parent, EINA_TRUE);
}
编辑者为: Brian Lee 02 12月, 2018

响应

6 回复
K Johnson

You may try adding a window object first by using elm_win_add() function and then try using below line of code

elm_win_alpha_set(win, EINA_TRUE);

I'm not sure whether it works in case of UIBuilder or not but it works in case of EFL as well.

Ref. Link: https://developer.tizen.org/ko/forums/native-application-development/how-make-transparent-background-native-app.?langswitch=ko 

Brian Lee

Thanks, but not helpful.

My latest attempt is this:

    uib_views_st* uibViews = uib_views_get_instance();
    elm_win_alpha_set(uibViews->get_window(), EINA_TRUE);

... but this does not work.

As stated in the docs (https://developer.tizen.org/design/wearable/structure/widgets) " Using a transparent background is recommended", but there is no information on how to do this when using the UI Builder.

This is a major oversight in the documentation.

K Johnson

I'm trying to implement this. I'll let you know if I find any way. Also please share your code if you can do it.

Hermet Park

It would be better if you share the procedure what you are trying to do. 

If you attach screenshots, that will be better.

Plus, Which tizen version of app are you making?

 

 

Jaehyun Cho

Hello Bryan Lee.

To make transparent window and view, you need to call the following functions in your MainView_onuib_view_create callback.

 

 //support alpha color in elm_win
 elm_win_alpha_set(uib_views_get_instance()->get_window(), EINA_TRUE);
 
 //hide elm_bg which has default background color
 evas_object_hide(uib_views_get_instance()->get_window_obj()->bg);
 
 //change naviframe style to "transparent/default" to use naviframe which has transparent background
 elm_object_style_set(uib_views_get_instance()->get_window_obj()->app_naviframe, "transparent/default");

Brian Lee

Woohoo! Thanks Jaehyun. Look like exactly what I need.

Thank you again,

Brian