The Amscrollingnavbar framework is a framework that pulls up the hidden navigation bar and drop-down display navigation bar, automl framework and the call to the open source framework is simple, and this section introduces you to the use of this framework.
First, download and import framework
Amscrollingnavbar
When you download the framework, you need to be careful to select v1.x, automl framework otherwise the version of Swift is downloaded, such as:
After the download, you only need to put the two files in the required project can be:
best automl framework
Second, introduce the header file and complete the related property settings
- First, you need to introduce the header file to be used in the Controller class.
- #import "Uiviewcontroller+scrollingnavbar.h"
- Complete the related property settings
In this framework we need an up-bound property, the function of which is to slide our control when the navigation bar can have a fade effect, first we put in the storyboard we want to use the control in, such as, will navigation The controller drags it in place of the original control, then sets its root controls to a new viewcontroller and drags it into the webview in the Viewcontroller, which is the same size as the current screen size.
After you drag the related control into the storyboard, select the WebView control to set its up-bound property with the value set to 0, and make the property and the WebView control connect to the VIEWCONTROLLER.M file, such as:
- @property ( Weak, Nonatomic) Iboutlet uiwebview *
- @property ( Weak, Nonatomic) Iboutlet nslayoutconstraint * toplayout
- Call the following method in the lazy load of webview to achieve the desired effect.
- [self followscrollview:_mywebview usingtopconstraint:self. Toplayout];
Third, in the viewcontroller.m file to achieve the effect
-
- - (uiwebview *)mywebview{
-
- Nsurl *url = [nsurl urlwithstring: @"http://www.hcios.com"];
-
- nsurlrequest *Request = [nsurlrequest requestwithurl:URL ];
-
- [self followscrollview:_mywebview usingtopconstraint:self. Toplayout]; ///Just write this code to
-
- [self settitle: @"test"];
-
- [_mywebview loadrequest:request];
-
- return _mywebview;
-
- }
-
- - (void)viewdidload {
-
- [Super Viewdidload];
-
- [self mywebview];
-
- }
Sample code Download
Amsrollingdemo
Amscrollingnavbar Framework (Auto-hide navigation bar) Usage Introduction