Languages

Menu
Sites
Language
when I press entry , screen moves up.

Hello, all.

Today, during my work, I meet an issue .

So, I'd like to ask some questions for entry.

 

Now, I'm making one frame with whole size's bg( this image has a red balloon).

And this balloon has some objects such as radion button, box, entry...etc.

Of course, this balloon includes all object, exactly.

 

But , If I press the entry object, input panel is activaed , as you know.

So, this bg moves up ( objects stay their position) 

As a results, some objects escape from balloon area.  

 

I want to know the api to be all objects in place.

Or to move up , together.

 

What's should I do?

If you know how to fix this bg , please let me know.

Thanks.

 

below is my code.

 

 grid = elm_grid_add(nf);
 evas_object_size_hint_weight_set(grid, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
 evas_object_size_hint_align_set(grid, EVAS_HINT_FILL, EVAS_HINT_FILL);
 elm_win_resize_object_add(nf, grid);
 evas_object_show(grid);

 imgBgTop = elm_bg_add(grid);

 char bufTop[PATH_MAX];
 app_get_resource("images/bg.png", bufTop, (int)PATH_MAX);
 elm_bg_file_set(imgBgTop, bufTop, NULL);
 evas_object_size_hint_weight_set(imgBgTop, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
 evas_object_size_hint_align_set(imgBgTop, EVAS_HINT_FILL, EVAS_HINT_FILL);
 
 evas_object_show(imgBgTop);
 elm_grid_pack(grid, imgBgTop, 0, 0, screen_width, screen_height);

...

 

 Evas_Object *c_height = elm_box_add(container);
 elm_box_horizontal_set(c_height, EINA_TRUE);
 evas_object_size_hint_weight_set(c_height, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
 elm_box_align_set(c_height, 0, 0);
 elm_box_padding_set(c_height, BOX_PADDING, 0);
 evas_object_show(c_height);


    Evas_Object *h_label = elm_label_add(c_height);
 evas_object_size_hint_max_set(h_label, ELM_SCALE_SIZE(50), ELM_SCALE_SIZE(BUTTON_SCALE_HEIGHT)); 
 
 char h_buffer[STRING_SIZE + SUBJECT_CHAR_LIMIT] = {'\0'}; 
    snprintf(h_buffer, sizeof(h_buffer), "<color=#000000><align=left>%s<align></color>", label_height);
 elm_object_text_set(h_label, _(h_buffer));
    evas_object_show(h_label);

    Evas_Object *h_entry = elm_entry_add(c_height);
    elm_entry_single_line_set(h_entry, EINA_TRUE);
    elm_entry_scrollable_set(h_entry, EINA_TRUE);
    elm_scroller_policy_set(h_entry, ELM_SCROLLER_POLICY_AUTO, ELM_SCROLLER_POLICY_OFF);
    Elm_Entry_Filter_Limit_Size h_limit = {VALUE_CHAR_LIMIT, VALUE_CHAR_LIMIT};
    elm_entry_markup_filter_append(h_entry, elm_entry_filter_limit_size, &h_limit);
    elm_entry_cnp_mode_set(h_entry, ELM_CNP_MODE_PLAINTEXT);
 elm_entry_input_panel_layout_set(h_entry, ELM_INPUT_PANEL_LAYOUT_IP);
 elm_entry_cursor_line_end_set(h_entry);
 elm_entry_text_style_user_push(h_entry, "DEFAULT='align=right'");
 
    evas_object_size_hint_weight_set(h_entry, 0.5, 0.5);
 evas_object_size_hint_max_set(h_entry, ELM_SCALE_SIZE(50), ELM_SCALE_SIZE(BUTTON_SCALE_HEIGHT)); 
    evas_object_size_hint_align_set(h_entry,EVAS_HINT_FILL, EVAS_HINT_FILL);

    elm_entry_entry_set(h_entry, view_data->height);
    evas_object_show(h_entry);

 elm_box_pack_end(c_height, h_label);
    elm_box_pack_end(c_height, h_entry);

 elm_grid_pack(grid, c_height, x1, y1, x2, y2);

 

 

Responses

5 Replies
colin Rao

Hi,

as your code, the 4th line "elm_win_resize_object_add(nf, grid);" , try to replace it by elm_naviframe_item_push(nf, "Item Title", NULL, NULL, grid, NULL);

I just assume that the nf is a naviframe widget, also, make sure the nf been added under to the comformant widget.

Kim

actually,,,,

I already used the api on code's bottom

 

 // Left Drawer
 panel = create_panel(grid);
 elm_object_part_content_set(grid, "elm.swallow.left", panel);

 /* Panel Background (Dimmed Area) */
 Evas_Object *bg = create_bg(grid);
 evas_object_smart_callback_add(panel, "scroll", panel_scroll_cb, bg);
 elm_object_part_content_set(grid, "elm.swallow.bg", bg);
 
 elm_grid_pack(grid, panel, 0, 0, screen_width, screen_height);

 nf_it = elm_naviframe_item_push(nf, "Personal Information", NULL, NULL, grid, NULL);  //grid ->genlist
 elm_naviframe_item_pop_cb_set(nf_it, naviframe_pop_cb, view_data);

 

As you said, I removed 'elm_win_resize_object_add' (  'elm_naviframe_item_push' was already in the code's bottom).

but, the action is the same.

what should i do ?

 

Carsten Haitzler

why are you using grid? avoid grid. all it does is add complicationss for you as you do not want what it provides. an exact stretchable grid of layout. you want tables, boxes etc. just add a bg to win - add as resize obj, then add box to win as resize obj, put label, scroller etc. in the box.

Kim

As you know, 'elm_grid_pack'  can be defined the posion, directly.

if I use box widget, I have to adjust the align. Don't you think ?

I'm a beginner for tizen platfrom .

my screen has complicated GUI. so, I used the grid.

it's not so easy as you think.

 

As you advice, I try to change my code.

But, I wanted to know easy API which I can use in this case.

 

 

 

Carsten Haitzler

do not use grid. it's the WORST widget to define layout. yes- use boxes, alignment, tables etc. - do not use grid unless what you actually want is a grid that resizes/squashes based on size (eg make grid 1/2 height - everything in it becomes /12 height). using grid means that font size changes will break your widget (if itgets bigger for example) or screen size changes - eg going to a tablet from a phone etc. will then make everything massive ans spaced out with "tiny" fonts etc.

 

grid is the worst thing to use. tables. boxes. use those.