언어 설정

Menu
Sites
Language
Naviframe ---How to clear all previous Elm_Object_Item ?

Hi,all

 I have a function to achieve  : my app first loads the startup view ,and then navigate to main view, once navigated to main view, I want to delete the startup view from the naviframe stack so that the main view become the bottom item of the stack.

How can I do that?  Any help will be thankful.

Responses

7 댓글
Mehedi Alamgir

As far as i know you can't delete all previous Naviframe view without deleting from the top view. What you can do, You can delete all views between bottom view and top view. You can get the bottom view using elm_naviframe_bottom_item_get api and then use   elm_naviframe_item_pop_to api to delete  all views in between top and bottom view. In this case , You need to have more than 2 naviframe view.

  Elm_Object_Item *bottom_view = elm_naviframe_bottom_item_get(naviframe);
  elm_naviframe_item_pop_to(bottom_view);
jian chen

Thanks for your reply. The elm_naviframe_item_pop_to​(bottom_view) can't meet my need , Maybe there is a opportunistic way to achive my function which I have not found now.  

Mehedi Alamgir

As Naviframe always poped from its front view according to its mechanism , So as far as i know it is not possible to  delete last view directly  without deleting forward views.

Eugene Kurzberg

Use elm_object_item_del() on the first Naviframe item.

jian chen

When navigated to mainview from startup view, We use the elm_object_item_del() ​to delete the startup view, but it just  delete the startup view , when press back at mainview ,it will navigate to a blank view .

so we can use a gloal int varible to record current_view,  when current_view=2,  excute the startup view behavior when press back key.   we use elm_object_item_del() ​ to decrease first view memory .

Eugene Kurzberg

Naviframe doesn't handle the hardware "back" button itself. Usually you would use the following code to subscribe your own callback:

eext_object_event_callback_add(navi, EEXT_CALLBACK_BACK, _navi_back_cb, data);

In this callback you can handle "back" button in the following manner to remove the view if there is more than one or minimize the window otherwise:

 

if (elm_naviframe_top_item_get(navi) == elm_naviframe_bottom_item_get(navi)) {
    elm_win_lower(win);
} else {
    elm_naviframe_item_pop(navi);
}

On the other hand if you are talking about software "back" button in view's title, you can hide it manually using the following signal:

elm_object_item_signal_emit(navi_item, "elm,state,prev_btn,hide", "elm");

 

jian chen

Thansk for your answer .

 if (elm_naviframe_top_item_get(navi) == elm_naviframe_bottom_item_get(navi)) { elm_win_lower(win); } else { elm_naviframe_item_pop(navi); }  is just the default behavior , if  we press back key when at main view, then we'll navigate to startup view, my goal is : if this is mainview, press back key, elm_win_lower(win)