Languages

Menu
Sites
Language
box layout with a sub table and a sub list show issue

Hi, All

Please help me to check my code. I cant see the list item on UI, what's wrong in my code? Thanks!

I have a main_box as the main view, and add a table & list as its children, but I just see the table on UI.

static void
create_main_view(appdata_s *ad)
{
    Evas_Object *main_scroller, *input_field_table;

	/* Naviframe */
	ad->nf = elm_naviframe_add(ad->conform);
	evas_object_size_hint_weight_set(ad->nf, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
	elm_object_content_set(ad->conform, ad->nf);
	evas_object_show(ad->nf);

	main_scroller = elm_scroller_add(ad->nf);
	elm_scroller_bounce_set(main_scroller, EINA_FALSE, EINA_TRUE);
	evas_object_size_hint_weight_set(main_scroller, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
	evas_object_size_hint_align_set(main_scroller, EVAS_HINT_FILL, EVAS_HINT_FILL);
	evas_object_show(main_scroller);

	ad->main_box = elm_box_add(main_scroller);
	elm_box_align_set(ad->main_box, 0, 0);
	evas_object_size_hint_weight_set(ad->main_box, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
	evas_object_size_hint_align_set(ad->main_box, EVAS_HINT_FILL, EVAS_HINT_FILL);//////
	evas_object_show(ad->main_box);
	elm_box_padding_set(ad->main_box, ELM_SCALE_SIZE(5), ELM_SCALE_SIZE(5));

	input_field_table = create_search_input_field_table(ad);
	evas_object_show(input_field_table);
	elm_box_pack_end(ad->main_box, input_field_table);

	ad->list = elm_list_add(ad->main_box);
	elm_list_mode_set(ad->list, ELM_LIST_COMPRESS);
	//evas_object_smart_callback_add(ad->list, "selected", list_selected_cb, NULL);

	elm_list_item_append(ad->list, "Alexander Holmes", NULL, NULL, item_selected_cb, "Alexander");

	elm_list_go(ad->list);
	evas_object_show(ad->list);
	elm_box_pack_end(ad->main_box, ad->list);

	elm_object_content_set(main_scroller, ad->main_box);

	ad->nf_it = elm_naviframe_item_push(ad->nf, "Search Friends", NULL, NULL, main_scroller, NULL);
	elm_naviframe_item_pop_cb_set(ad->nf_it, naviframe_pop_cb, ad);
}

 

Responses

14 Replies
colin Rao

~i cant paste the full code of the create_search_input_field_table(ad) part, blocked by the Mollom privacy policy.

just put the table create related code here, this table is a 3 coloums and 3 rows table.

 table = elm_table_add(ad->main_box);
 elm_table_homogeneous_set(table, EINA_TRUE);
 evas_object_size_hint_weight_set(table, EVAS_HINT_EXPAND, 0.0);
 evas_object_size_hint_align_set(table, EVAS_HINT_FILL, EVAS_HINT_FILL);
 evas_object_show(table);
 elm_table_padding_set(table, ELM_SCALE_SIZE(5), ELM_SCALE_SIZE(5));

Alex Ashirov

Hi,

You can try to remove the table from the box (just for investigating purposes) and check is the list visible in this case.  If it is visible then you can try to play with elm_list_mode_set() parameter.

colin Rao

Strange!!! remove the table, still can't see the list. 

colin Rao

It's works after I add bleow function call.

evas_object_size_hint_weight_set(ad->list, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
evas_object_size_hint_align_set(ad->list, EVAS_HINT_FILL, EVAS_HINT_FILL);

 

Daniel Juyung Seo

Great.

That's because the size of scrollable widgets like list, genlist, gengrid, scroller needs is not decided by their contents normally. You have to explicitly describe their size.

In this case, you set list's size hint by using weight/align set as list is pack into box.

So list will fill out box.

 

Thanks.

Anusha Sajeendran

Hi,

Please help me to create a simple table in Tizen Native Application. Is it necessary to have <FUi.h> files..

Alex Ashirov

Hi,

It seems that you are using old SDK version 2.2.1. Please install and use new Tizen SDK 2.3:

https://developer.tizen.org/downloads/tizen-sdk

Anusha Sajeendran

Thanks for replying, but I'm using Tizen SDK 2.3.0 only.

Alex Ashirov

Hi,

In this case you don’t need <FUi.h>. Please read the following documents about how to create the table container in the Tizen SDK 2.3.0:

https://developer.tizen.org/documentation/mobile-native-app-programming/programming-guide/ui-creating-application-ui/widgets/container-widgets/table-container

https://developer.tizen.org/dev-guide/2.3.0/org.tizen.mobile.native.apireference/group__Table.html

 

colin Rao

All the EFL widgets header file are loaded in the Elementary.h file, this file are added into your main.h file while you create a new native app project.

#ifndef __main_H__
#define __main_H__

#include <app.h>
#include <Elementary.h>
#include <system_settings.h>
#include <system_info.h>
#include <efl_extension.h>
#include <dlog.h>

Anusha Sajeendran

Hi,

Please help me to check the code. I am trying to create a tablecontainer with two rows and two column with a label inside it

Evas_Object *table= evas_object_table_add(box);
    evas_object_table_homogeneous_set(table, EVAS_OBJECT_TABLE_HOMOGENEOUS_NONE);
    evas_object_table_padding_set(table, 0, 0);
    evas_object_resize(table, 10, 10);
    evas_object_show(table);

    Evas_Object *label = elm_label_add(table);
    elm_object_text_set(label, "Label1");
    evas_object_color_set(label, 255, 0, 0, 255);
    evas_object_size_hint_min_set(label, 100, 50);
    evas_object_show(label);
    evas_object_table_pack(table, label, 1, 1, 2, 1);

 

 

 

colin Rao

try this,

    Evas_Object *table = elm_table_add(box);
	elm_table_homogeneous_set(table, EINA_TRUE);
	evas_object_size_hint_weight_set(table, EVAS_HINT_EXPAND, 0);
	evas_object_size_hint_align_set(table, 0, 0);
	elm_table_padding_set(table, ELM_SCALE_SIZE(5), ELM_SCALE_SIZE(5));
	evas_object_show(table);
	elm_box_pack_end(box, table);

	Evas_Object *label = elm_label_add(table);
	elm_object_text_set(label, "Label1");
	evas_object_color_set(label, 255, 0, 0, 255);
	evas_object_size_hint_min_set(label, 100, 50);
	evas_object_show(label);
	elm_table_pack(table, label, 0, 0, 2, 2);

 

Anusha Sajeendran

Hi,

Thank you . Your code is working great, is there any code for getting border for the table.. ???

colin Rao

Hi,

unfortunately, there's no a directly way to setting the border of table, not only the table, but also all the elf widgets.  From the help doc, seems we can customize the widget's style(such a the border, background, .etc) in edje.

https://developer.tizen.org/documentation/mobile-native-app-programming/programming-guide/ui-creating-application-ui/widgets/widget-customization

https://developer.tizen.org/documentation/articles/ui-sample-themeextension-sample-overview