Simple implementation of navigation bar on both sides of IOS

Source: Internet
Author: User

The emergence of elements in the left-side Navigation Pane of a mobile app is probably the evolution of most apps from the top-down tab to the left-side menu in the middle of last year.

The concept of the design in the left-side navigation bar is to reduce the user interface of the mobile application, and this design is also widely used in Web applications. For example, Douban FM,

It is similar to the design with the left drawer.

For the drawer concept of the general concept, andriod has already provided the API provided by the slidingdrawer SDK. However, a large number of implementations in the future are custom frame la s or others.

In the design of mobile application interface interaction, the appearance of the left-side navigation bar is indeed a novelty compared to the traditional switch between upper and lower tabs, and the space on the control layout is reduced.

As a cool person, I was planning to make a visual reconstruction of our company's application navigation in the early days.

However, we did not make any changes to the user's age and focus of our applications.

Because for users over 30 years old, they are habitually and traditional conservative ideas.

For some fashion, technology, awesome, and social networking applications, you can make some innovative designs.

Therefore, my personal consideration is that in two cases,

First, navigate to the switch bar with more than two levels.

Second, idle egresses

First, draw a simple illustration.

Assume that 1, 2, 3, 4, and 5 are level-1 switching menus;

T1, T2, T3 .. Is the second-level switch menu.

If you do not use the next book to switch the tab menu, the space displayed in the middle will be relatively small. Now you can consider using the left-side menu bar.

...

The general model is as follows.

You can implement the following options: menu on the left, menu on the right, and menu on both left and right.

General principles and steps:

1. sidenav is designed as a viewcontroller control to manage and control three viewcontrollers: leftvc, rootvc, and rightvc. It is also a common idea. For example, tabviewcontroller is similar, it can be understood as a controller that manages viewcontroller.

2. setter content, left, right navigation bar controller. At the same time, you need to reset the content page, that is, the navbar of rootviewcontroller. For example, if it is only setleft, only the left button is displayed.

3. Implementation of the menu on the left: Because sidenav is also a viewcontroller, it comes with a view. When rootviewcontroller is set by default (or the content viewcontroller ),

During display, the view of rootviewcontroller is attached to the view of sidenav. When you click the menu bar on the left, insert the view in leftvc to the first subview of the view of sidenav, rootview becomes the second layer, and then moves the entire rootview to the right on the left side of the source of the rootview. The idea is the same in the navigation bar on the right.

4. Click a menu button on the menu control interface on the left to jump to the switchover. The previous code example uses the idea of a global controller and directly obtains the sidenavvc object based on appdelegate,

You can also consider using delegation.

5. gesture, refinement and improvement.

This demo is used in an early application because the data is sourced from the Internet. It is a simplified and simple version.

: 1. You can set one or more columns,

2. Custom visible menu areas on both sides.

3. modify some gesture implementation code

4. Some new bugs have been created.

Personal suggestion: The overall demo reference can be divided into two parts: 1. Basic model switching; 2. Optimized addition of gesture animation effects.

Demo: not planted, tens of thousands of moles.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.