Enhancing a mobile app with the native header
Standardize the user experience in your mobile apps by adding the native header for a custom mobile page. By using the native header in your app, you provide users with a responsive interface that is consistent across native apps and different devices. For example, users can navigate to the previous view by using the native back button for Android apps or a swipe right gesture for iOS apps.
- Harness
- A container for your mobile page, in which you embed the wrapper section.
- Wrapper section
- A wrapper container, in which you embed the template-based section and adjust the layout properties to set a custom title for the native header.
- Section with a mobile header template
- A template-based section with the native header, in which you can configure optional left and right actions.
- In the header of Dev Studio, click .
- On the Create harness tab, in the Label field, provide the name for the harness.
- In the Context section, define the application, class, and target
ruleset for the harness.
- Click Create and open.
- On the Advanced tab, in the Harness usage section, select the Work area check box.
- On the Design tab, select the screen layout, and then click the View properties icon.
- In the Screen layout properties window, on the
General tab, select Header,
and then click Submit.The upper area of a header-type screen layout is a placeholder in which you add the elements that constitute the header of the page in the mobile app.
- Expand the Structural list, and then drag Embedded section onto the upper area of the screen layout.
- In the Section include modal dialog box, in the Section field, click the Open icon.
- On the Create section form, specify the label for the
wrapper section, and then click Create and open.To ensure that the wrapper section works with your harness, the Apply to and Add to ruleset fields automatically include the class and ruleset of the harness.
- In the header of the section editor, click Convert to full section editor, and then confirm the conversion.
- On the Design tab, expand the Structural list, and then drag Embedded section onto the canvas, below the default dynamic layout.
- In the Section include modal dialog box, in the Section field, click the Open icon.
- On the Create section form, specify the label for the
template-based section, and then click Create and
open.To ensure that the template-based section works with your harness, the Apply to and Add to ruleset fields automatically include the class and ruleset of the harness..
- On the Design tab, in the template elements pane on the right, click Change, and then click the Mobile page header with left and right action design template.
- Optional: To add left or right actions to the mobile header, add a Button to the Left actions or
Right actions sections of the template elements pane. For example, add a native search button as the right action on the native header:
- In the Right actions section, click .
- Hover over the button, and then click the Edit icon.
- On the General tab, clear the Text field.
- In the Image source list, select Icon class.
- Click the Open the class picker icon to display all available icons.
- Search for and select the pi-search icon.
- On the Actions tab, click Create an action set.
- Click .
- Click , and then, in the Display category, click Mobile search.
- Click Submit.
- On the template-based section rule form, click Save.
- Click the tab with your wrapper section.
- In the Section include modal dialog box of the wrapper section, in the Section field, enter the name of the template-based section that you created, and then click Submit.
- Select the default dynamic layout, and then press the Delete key to remove it from your canvas.
- Select the embedded section, and then click the View properties icon.
- In the Layout properties window, in the Container format list, select Other, and then enter Mobile header.
- Select the Display header and title check box.
- In the Container settings section, in the Title list, select Text, and then enter the custom title of your header.
- Click Submit.
- On the wrapper section rule form, click Save.
- Click the tab with your harness.
- In the Section include modal dialog box of the harness, in the Section field, enter the name of the wrapper section that you created, and then click Submit.
- On the Design tab, configure the main content of your page by adding elements from the palette to the bottom area of the screen layout.
- On the harness rule form, click .
- On the harness rule form, click Save.
- Add the page with the native mobile header to the navigation of your mobile
channel.For more information, see Adding items to the menu bar.
Creating a harness for your page
Configuring the harness to support the native header for your page
Creating a wrapper section for the native header
Creating and configuring the template-based section for the native header
Configuring the wrapper section and adding a custom header title
Configuring the harness with the native header
Previous topic Tracking mobile users based on geolocation data Next topic Localizing mobile apps for international audiences