繁体   English   中英

如何将背景添加到基本(EFL)小部件?

[英]How to add background to elementary(EFL) widget?

我想要背景色(或图像)到基本小部件(也包括容器),例如网格或框。

如何为基本小部件设置背景颜色?

在EFL基本文档中,我找到了elm_bg函数,但无法将其设置为其他基本容器的背景...

使用elm_table小部件。 通过使用表格,可以将多个对象打包到同一位置。

  1. 创建elm_table。
  2. 创建elm_bg(您可以按颜色或图像设置bg。
  3. 使用容器小部件的相同位置将bg打包到表中。

谢谢。

在tizen.org上也被问到,这部分显然还不清楚

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

主题化是方法,在先前的URL上共享示例代码。

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);

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM