【问题标题】:How to add background to elementary(EFL) widget?如何为基本(EFL)小部件添加背景?
【发布时间】:2014-07-14 06:17:32
【问题描述】:

我想要基本小部件(也是容器)的背景颜色(或图像),如网格或框。

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

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

【问题讨论】:

    标签: widget background-image tizen efl elementary


    【解决方案1】:

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

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

    谢谢。

    【讨论】:

    • 但我不能在我的窗口中使用表格容器。必须确保将每个小部件都围绕在表格中作为背景?
    • 您不能在顶层使用表格,然后将整个布局与背景一起放入该单元格中吗?
    【解决方案2】:

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

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

    主题是要走的路,在以前的网址共享示例代码。

    【讨论】:

      【解决方案3】:
      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);
      

      【讨论】:

        猜你喜欢
        • 2020-11-22
        • 1970-01-01
        • 2020-09-07
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2013-03-09
        • 2018-09-14
        相关资源
        最近更新 更多