Amscrollingnavbar Framework (Auto-hide navigation bar) Usage Introduction

Source: Internet
Author: User


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.
    1. #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:





    1. @property ( Weak, Nonatomic) Iboutlet uiwebview *
    2. @property ( Weak, Nonatomic) Iboutlet nslayoutconstraint * toplayout
    • Call the following method in the lazy load of webview to achieve the desired effect.
    1. [self followscrollview:_mywebview usingtopconstraint:self. Toplayout];
Third, in the viewcontroller.m file to achieve the effect
  1. - (uiwebview *)mywebview{
  2. Nsurl *url = [nsurl urlwithstring: @"http://www.hcios.com"];
  3. nsurlrequest *Request = [nsurlrequest requestwithurl:URL ];
  4. [self followscrollview:_mywebview usingtopconstraint:self. Toplayout]; ///Just write this code to
  5. [self settitle: @"test"];
  6. [_mywebview loadrequest:request];
  7. return _mywebview;
  8. }
  9. - (void)viewdidload {
  10. [Super Viewdidload];
  11. [self mywebview];
  12. }
Sample code Download


Amsrollingdemo



Amscrollingnavbar Framework (Auto-hide navigation bar) Usage Introduction


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.