How to add background to elementary(EFL) widget?

风格不统一 提交于 2019-12-07 02:39:27

Also asked on tizen.org, this part is unclear apparently

https://developer.tizen.org/ko/forums/native-application-development/how-change-button-background-color

Theming is the way to go, sample code shared at previous URL.

Use elm_table widget. By using table, you can pack multiple objects into the same position.

  1. create elm_table.
  2. create elm_bg (you can set bg by color or a image.
  3. pack that bg into table with the same position of your container widget.

Thanks.

Evas_Object *bg = elm_bg_add(parent);

// Set a color
elm_bg_color_set(bg, 64, 127, 256);

// Set a background image
elm_bg_file_set(bg, "/path/to/the/image", NULL);

// Create your grid or box component with the background as parent
Evas_object *box = elm_box_add(bg);

/* Load content at the topmost layer of the background */
/* Note that the background has a swallow part and there is where our box will go */
elm_object_content_set(bg, box);
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!