Need help with GTScrollNavigationBar?
Click the “chat” button below for chat support from the developer who created it, or find similar developers for support.

About the developer

luugiathuy
559 Stars 91 Forks BSD 3-Clause "New" or "Revised" License 90 Commits 13 Opened issues

Description

A scrollable UINavigationBar that follows a UIScrollView

Services available

!
?

Need anything else?

Contributors list

# 55,248
Objecti...
Kotlin
Android
React
65 commits
# 254,478
iOS
Objecti...
Shell
Ruby
8 commits
# 145,508
Objecti...
Swift
Shell
iOS
4 commits
# 362,490
Swift
Objecti...
iOS
Shell
1 commit
# 311,897
iOS
Objecti...
Shell
uiscrol...
1 commit
# 441,456
iOS
Objecti...
Shell
Ruby
1 commit

GTScrollNavigationBar

CocoaPods Version Build Status Coverage Status

A lightweight scrollable UINavigationBar that follows a UIScrollView. This project was inspired by the navigation bar functionality seen in the Chrome, Facebook and Instagram iOS apps.

GTScrollNavigationBar Screenshot 1 GTScrollNavigationBar Screenshot 2

Installation

CocoaPods

Add pod

GTScrollNavigationBar
to your Podfile.

Manually

Add the

GTScrollNavigationBar
folder to your project.
GTScrollNavigationBar
uses ARC, so if you have a project that doesn't use ARC, add the
-fobjc-arc
compiler flag to the
GTScrollNavigationBar
files.

Usage

Set up the navigation controller to use

GTScrollNavigationBar
:
#import "GTScrollNavigationBar.h"

self.navController = [[UINavigationController alloc] initWithNavigationBarClass:[GTScrollNavigationBar class] toolbarClass:nil]; [self.navController setViewControllers:@[self.mainViewController] animated:NO];

In your view controller which has a

UIScrollView
, e.g.
UITableViewController
, set the UIScrollView object to the
GTScrollNavigationBar
in
viewWillAppear:
or
viewDidAppear:
by:
self.navigationController.scrollNavigationBar.scrollView = self.tableView;

To unfollow the scrollView, simply set

scrollView
property to
nil
self.navigationController.scrollNavigationBar.scrollView = nil;

Implement

scrollViewDidScrollToTop:
in the view controller to reset the navigation bar's position
- (void)scrollViewDidScrollToTop:(UIScrollView *)scrollView
{
    [self.navigationController.scrollNavigationBar resetToDefaultPositionWithAnimation:NO];
}

Contact

@luugiathuy

We use cookies. If you continue to browse the site, you agree to the use of cookies. For more information on our use of cookies please see our Privacy Policy.