- About the system navigation bar is really let people love and hate, Love is Apple itself to the package of this control is very perfect, including memory, landscaping, gradient animation and so on, generally speaking, basically all the requirements can be met. But you need to know what is going to happen in China, and it will change, for example, data concurrency in the background. In the domestic wonderful product design, navigation bar is beyond recognition, anyway, I saw the more famous app, found that their navigation bar is basically a custom, which involves the biggest problem is the navigation bar itself hidden, color gradient.
- In fact, when running through the app, you can see the layering of the system Navigationbar. A navigationbar is a lot of layers, not the outermost layer we see, it has the control of color layers, there are navigationitem layers to place controls, and so on, interested can be through Xcode debug Navigator--->view UI Hierarchy, similar to the Reveal tool.
- The system's navigation bar is not much to say, because when you use the custom navigation bar, basically is your product demand, the system navigation bar has not satisfied, or said satisfies extremely troublesome. I also encountered a period of time such a tangled product demand, home navigation bar hidden, some hidden behind the interface, some do not hide, then in order to prevent push/pop sliding animation when the navigation bar produced black bar, need to make a series of settings, extremely troublesome. As for why, in this explanation, because when you set the Navigationcontroller, there is always only one navigationcontroller in this stack. At the same time, Navigationbar is always only one, but why the navigation bar of each interface can be placed in different controls? That's because the navigationitem of the placement control is initialized for each interface, praising the ingenuity of the Apple engineer again, but this leads to a problem where the life cycle of the different interfaces will converge in Viewwillappear and Viewwilldisappear, Then the system's Navigationbar will be affected. This is why when you set up different controls, the system Navigationbar looks normal, but the transparency and color of your navigationbar will come up with various problems.
- For the reasons above, I have customized Navigationbar and Navigationitem. At first, I placed the custom Navibar and Naviitem in the Uinavigationcontroller category, and later I discovered that because the navigationcontroller of the system was initialized only once in a stack, This causes the Navibar of the interface after each push to overwrite the previous interface, resulting in the inability to manipulate the navibar of the previous interface after the return, and I think the sex system may have been recorded in some way, but I'm not sure yet. So I can only go back and then put it in the Uiviewcontroller category, which is a perfect solution to these problems.
- Item Https://github.com/jizhidejingmo/YYNavigationBar
Some things about the iOS system navigation bar and the custom navigation bar