andreamazz / amscrollingnavbar Goto Github PK
View Code? Open in Web Editor NEWScrollable UINavigationBar that follows the scrolling of a UIScrollView
License: MIT License
Scrollable UINavigationBar that follows the scrolling of a UIScrollView
License: MIT License
hi all.
i'm testing AMScrollingNavbar in UITableViewController not UIViewController in UIViewController+ScrollingNavBar.h, m.
and some changes "AMTableViewController"
remove tableView Pointer, and delegate, something.
it's work fine in UINavigationController -> UITableViewController.(rootView)
but this is not work.
NavigationController -> TabBarViewController -> UITableViewController(Tab)
there are something Black Cells in top table.
did you experience this happen?
i'll send you my samples. can u test me?
please let me know your emails thanks!
Hi,
I found a problem in line 353 of your category:
frame.size.height = [UIScreen mainScreen].bounds.size.height - frame.origin.y;
In my case, the scrollable view is the content of a tab bar view controller. With the line above the scrollable view will be resized by ignoring the tab bar.
As improvement, I would appreciate if you could change this part like this (line numbers refers to commit eef1dbd)
- (void)setInitialScrollableViewHeight:(float)initialScrollableViewHeight { objc_setAssociatedObject(self, @selector(initialScrollableViewHeight), [NSNumber numberWithFloat:initialScrollableViewHeight], OBJC_ASSOCIATION_RETAIN); }
- (float)initialScrollableViewHeight { return [objc_getAssociatedObject(self, @selector(initialScrollableViewHeight)) floatValue]; }
followScrollView:
is called[self setInitialScrollableViewHeight:0.0f];
if ([self initialScrollableViewHeight] == 0.0f) {
[self setInitialScrollableViewHeight:self.scrollableView.superview.bounds.size.height];
}
if (frameNav.origin.y == [self statusBar]) {
frame.size.height = [self initialScrollableViewHeight];
} else {
frame.size.height = [self initialScrollableViewHeight] + frameNav.size.height;
}
Thank you!
Having a issue with my nag bar items still appearing a few pixels in the status bar and not getting the ease out animation when scrolling up
Whats the best way to temporary disable scrolling? I already tried to disable scrolling on my scrollview and setting followscrollview to nil but the navbar continues hiding.
4.0 do not support ios5 +๏ผ
Hi, I am using this in a UIViewController, as a child view controller of a uitabbarcontroller. After scroll, the tableView (root view in UITableviewController) will have an offset below the navigation bar. The extra space is about the height of the navigation bar. From Xcode, if I uncheck the Adjust Scroll View Insets
checkbox for the view controller, the extra space will disappear after scroll, but the content section will go under the nav bar before the scroll.
To repro this, go with the instruction video, but after embedding the UIViewController with a navigation controller, connect this navigation controller to a UITabbarController. I am using the latest version 1.0, installed via cocoapod.
It would be good to have a feature that blocks the pan gesture on the X-axis when a user let's say pans on the Y-axis and the navbar hides. One pan gesture at a time.
Nice project, congratulations!
I have problems when I use the UIRefreshControl in a UITableView.
In some cases the effect latch, but returns. In the other UITableView disappears.
It would also be interesting if there was an option to remove the followScrollView
.
I dont know if there's interest in it responds to iOS 6 in cases where the app has status bar fixed.
It is just several lines, so I didn't submit a request.
The isExpanded and isCollapsed should be set to NO when the following situation happening.
- (void)scrollWithDelta:(CGFloat)delta
{
CGRect frame;
if (delta > 0) {
if (self.isExpanded) {
self.isExpanded = NO;
}
...
}
if (delta < 0) {
if (self.isCollapsed) {
self.isCollapsed = NO;
}
...
}
}
Hi! @andreamazz
look this picture:
Jack
But gotta say, it's really not that bad. Way better than the other implementations I've seen so far.
Also props for all the code you have been writing and sharing. Really nice to see how many libraries you have created!
First of all, this library is awesome and thanks a lot for sharing it with community!
I've found a little but confusing bug (devil is in the detail). Here is a little description:
When you scroll down and AMScrollingNavbar
starts hiding (you have to do it slowly) and you gently move your finger in other direction (left or right) but still keep scrolling down you'll face a little twitching of scroll indicator.
I've also tested your demo app and it is facing the same issue. For a better visiualization (I hope becuse the movie quality is poor) take a look at this movie.
I suggest you test it by yourself! And answer me if you've also had the same problem or maybe a solution! I know you can always hide scroll indicator but it's nice to show user when he currently is :)
I'm using AMScrollingNavbar in iOS 7 to hide the navigation bar when scrolling in a UITableView. However, when I tap on a cell's header to segue to a new view controller, the navigation bar of the destination view controller does a resize animation to 64px (44px navigation title bar + 20px status bar) and it's very noticeable. When I pop back to the first view controller, the navigation bar maintains that 64px, and not the 20px (only the status bar) it originally had before the segue.
Is there a way to prevent this or is this a bug?
When a user scrolls the content inside the detail view controller, and then uses the swipe from left edge to go back to the root view controller, the navigation bar is still hidden.
When I have my nav bar in a collapsed state and then send my app to the background (for example, press the home button) then bring my app back - the nav bar is displayed. However the tinted bar is still covering the title AND my scroll view now goes behind the nav bar. navigating away and back to the same view fixes it.
installed via cocoapods - version 0.5.1 (also tested in 0.5)
I haven't completely nailed this down yet but it seems to be tinting (or maybe partially obscuring with the tinted layer?) the left and right bar button items on the navigation controller's push and pop events. Seems to only happen when I'm not following any scroll view. I'll try to get more info.
Update: this doesn't happen in 0.5.2 (Haven't tried 0.5.3 yet -- was using :head)
Hi๏ผ@andreamazz
If i show the tableView on UITabBarController first viewController. scroll the tableView hidden UITabbar view.
Jack
Instead of having copy/paste classes for view, table and collection controllers, all code should be moved to a category. All the properties you need should be implemented using associated objects (http://nshipster.com/associated-objects/)
Cool category, keep up the good work!
ios7, device, in code
Is this just not supported?
Hi there,
I just tried your sample project and swapped the RootViewController-property from the AMViewController to the AMTableViewController, but now, just after having scrolled a bit, everything below the UINavigationBar is having a top-offset of approximately the height of the UINavigationBar. Am I missing something or is this a bug?
Thank you very much,
Phil
There is a black area below the navigation bar in ios 6 when starting scrolling
Is it possible to add a tap gesture recognizer to show the navbar if the user taps the status bar? Also, when using this with a view controller in a tabbar, there is an offset in the origin.y of the frame, I have attempted a fix, but it's not going very well, so if you have any suggestions, that'd be great! Thanks!
I get same issue and can't solve it.
I seen you comment #34 (comment) but it didn't help me.
I added UIView to my Navigation Bar, then I added UILabel to this UIView and then I added Constraints to this UILabel like on here
What I did wrong, could explain what constraints should to be there?
Thanks,
Alex.
My application do not show the status bar on top, that brings some weird issue? how can i fix this?
When you set insets in code to fulfil you needs (e.g. extend under UITabBar
) scrollViewShouldScrollToTop:
method stops working when you scroll to the bottom of UITableView
.
In my code I've set [self.tableView setContentInset:UIEdgeInsetsMake(0, 0, 44, 0)];
because last row of UITableView
was missing and this bug occurred. Also, when you set Adjust Scroll View Insets the same bug appears.
I don't know how to make all rows visible and keep scrollViewShouldScrollToTop:
working everytime?
I have this. It happens not always. Why this can happens ?
I see the trick that hide the scrollview indicator jitter.
[[self scrollView] setShowsVerticalScrollIndicator:NO];
But compare the Instagram and Facebook. The indicator always visible.
Is there any way make things happen exactly like Instagram?
I tried integrating this with the app I'm currently working on and it shows a view above the table view as I scroll down.
Btw I'm using a tableview inside a UITabBarview controller
Hey, thanks for the library, it's awesome. I'm facing an issue. On the gif above you can see 2 tables. 1st one is AMScrollingNavbarViewController with UITableView in it. And this one works great. 2nd is a UITableViewController deriving from AMScrollingNavbarTableViewController. This one creates a black gap, i think of size of the navigation bar. I setup the views in storyboard and except for standard data source things I did
[self followScrollView: self.tableView];
in viewDidLoad. Any hints about this problem?
Thanks in advance.
When I scroll up the scrollview, sometimes it works well. But sometimes my UIBarButtonItem didn't show correctly, in some case the navigation bar dismiss. I can not get the bar back when I scroll down.
If bar button item was not an array. Sometimes it wasn't set the alpha value correctly.
One that I encountered was their alpha value became 0.0f and even it was set back to 1.0f it's still invisible.
This is the original code.
- (void)updateNavbarAlpha:(CGFloat)delta
{
...
[self.navigationItem.leftBarButtonItems enumerateObjectsUsingBlock:^(UIBarButtonItem* obj, NSUInteger idx, BOOL *stop) {
obj.customView.alpha = alpha;
}];
[self.navigationItem.rightBarButtonItems enumerateObjectsUsingBlock:^(UIBarButtonItem* obj, NSUInteger idx, BOOL *stop) {
obj.customView.alpha = alpha;
}];
...
}
This is how I managed to fixed that.
- (void)updateNavbarAlpha:(CGFloat)delta
{
...
[self.navigationItem.leftBarButtonItems enumerateObjectsUsingBlock:^(UIBarButtonItem* obj, NSUInteger idx, BOOL *stop) {
obj.customView.alpha = alpha;
}];
self.navigationItem.leftBarButtonItem.customView.alpha = alpha;
[self.navigationItem.rightBarButtonItems enumerateObjectsUsingBlock:^(UIBarButtonItem* obj, NSUInteger idx, BOOL *stop) {
obj.customView.alpha = alpha;
}];
self.navigationItem.rightBarButtonItem.customView.alpha = alpha;
...
}
not pointing at 0.5
Do you think that it can be possible to use AMScrollingNavbar without subclassing? I want to continue UITableViewController.
Hello,
The sample tableview controller sample uses AMScrollingNavBar which is itself a UIViewController.
Before I try and look under the hood, just how feasible do you think it would be to get it working with my subclassed UITableViewController:
(master class which is a UITableViewController)
CoreDataTableViewController ->
(sub class of CoreDataTableViewController)
UsesTableViewController
any thoughts?
thank you.
Hi, thanks for this great library. ๐
I couldn't find any documentation on using the project with UITableViewController, and when I use it with a table view controller "out of the box":
[self followScrollView:self.tableView]
there is a 64px gap added to the frame as soon as I start scrolling.
Can you update the specs file so that it'll point to the latest version with the fixes. Currently it uses 0.5.4 tag which is 2 months old:
s.source = { :git => "https://github.com/andreamazz/AMScrollingNavbar.git", :tag => '0.5.4' }
Thanks for you work!
Hello,
There should be support for collapsing the toolbar together with the navigation bar (like in Safari).
Should be easy to achieve.
Hi,
It should be out off topic.
When I add the library to my VC and start scrolling the tableview an extra space appears between the status bar and my tableview.
I don't use storyboard neither xib , and I suspect it's due to the constraints.
Could you tell me how can I add them by code?
Thanks
What if I programatically made a UITableViewController. There is no View where I can connect an IBOutlet for tableView, therefore
[self followScrollView:self.tableView]; --> will not work for me... how can I call this method in my case?
I have a array of AMScrollingNavbarViewController that showed inside UIPageViewController. View was not shrink or expand properly when I scrolled to hide/show UINavigationBar. It was shrink without adjust a proper value. So I can saw the black background behind the UINavigationBar
some odd issue, I tried to make it work with a web view.
when I Enabling the scrolling it's working great, but when I flip my device to horizontal my google ad disappear , is there any way to fix it ?
I don't know is it a bug, but below findings
if (self.scrollableView != nil) {
if (self.isCollapsed) {
CGRect rect;
if ([self.scrollableView isKindOfClass:[UIWebView class]]) {
rect = ((UIWebView*)self.scrollableView).scrollView.frame;
} else {
rect = self.scrollableView.frame;
}
NSLog(@"%f", rect.origin.y);
// problem here
//(x, y) = (0. -64)
//(w, h) = (320,563)
// Non-Auto Layout
//(x, y) = (0. 0)
//(w, h) = (320,499)
// Auto layout
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.