Naviframe
A naviframe component consists of a stack of views. New views are pushed on top of previous ones, and only the top-most view on the stack is displayed. The previous views are not deleted. A previous view is displayed when the view on top of it is popped. Transitions can be animated on a push or a pop, depending on the theme applied to the UI component.
Creating a Naviframe
To create a naviframe, use the elm_naviframe_add() function:
Evas_Object *nav; nav = elm_naviframe_add(parent);
Adding and Deleting Views
The naviframe is a stack of views. A new view is always pushed to the top of the stack. The top-most view is deleted by popping it.
To add a new view to the naviframe:
Elm_Object_Item *nav_it; // In Tizen 2.4, the back button is automatically pushed if // elm_naviframe_prev_btn_auto_pushed_set(nav, EINA_TRUE) is called nav_it = elm_naviframe_item_push(nav, NULL, NULL, NULL, view, NULL);
When you push a new view to the stack, you receive an Elm_Object_Item for the view. You can use this item to modify the view.
To pop and delete the top-most view:
elm_naviframe_item_pop(nav);
Adding Fixed Content
The naviframe can display fixed content on top of the current (top-most) view. Use the elm_object_item_part_content_set() function to set this content. Use the following part names to specify the location of the content:
- default: The main content area of the current view.
- title_left_btn: A button on the left side of the naviframe.
- title_right_btn: A button on the right side of the naviframe.
For example, to add a button to the naviframe:
btn = elm_button_add(nav); elm_object_style_set(btn, "naviframe/title_cancel"); elm_object_item_part_content_set(nav_it, "title_left_btn", btn);
To set the title labels of the naviframe, use the elm_object_item_part_text_set() function and specify one of the following label locations:
- default: Sets the title label in the title area of the current view.
- subtitle: Sets the subtitle label in the title area of the current view.
Listening to Signals
To receive notifications about the naviframe events, listen to the following signals:
- transition,finished: The transition has finished changing the view.
- title,transition,finished: The title area transition has finished changing the state of the title.
- title,clicked: The user has clicked the title area.
Note |
---|
Except as noted, this content is licensed under LGPLv2.1+. |