Last comment, I promise, everything else is perfect.
I have a UITableView with a UISearchBar, and a UIRefreshControl. My goal is to add this GTScrollNavigationBar (with the addition of a sub menu Issue #1 ). When the search bar is visible by default, there are no issues. But when the search bar is set to be hidden by default it screws things up.
Start by modifying the example by:
- Modify DemoTableViewController.h
@interface DemoTableViewController : UITableViewController <UISearchBarDelegate, UISearchDisplayDelegate> {
UISearchBar *searchBar;
UISearchDisplayController *searchDisplayController;
}
2.Modify DemoTableViewController.m
- (void)viewDidLoad
{
[super viewDidLoad];
UIRefreshControl *refreshControl = [[UIRefreshControl alloc] init];
[refreshControl addTarget:self action:@selector(refresh:) forControlEvents:UIControlEventValueChanged];
self.refreshControl = refreshControl;
//Uncomment this line, to reproduce the issue
//[self.tableView setContentOffset:CGPointMake(0,44) animated:YES];
searchBar = [[UISearchBar alloc] initWithFrame:CGRectMake(0, 0, 320, 44)];
searchBar.placeholder = @"Filter Types";
searchDisplayController = [[UISearchDisplayController alloc] initWithSearchBar:searchBar contentsController:self];
searchDisplayController.delegate = self;
searchDisplayController.searchResultsDataSource = self;
searchDisplayController.searchResultsDelegate = self;
self.tableView.tableHeaderView = searchBar;
}
- (void)refresh:(UIRefreshControl *)refreshControl {
[refreshControl endRefreshing];
}
Run this, and everything performs as expected. Then uncomment [self.tableView setContentOffset:CGPointMake(0,44) animated:YES];. Now, tap and hold near the bottom of the screen and drag up. Instead of the the menu scrolling out of view, it will almost disappear, and then snap back to normal height. It will continue this snapping until you remove your finger from the screen.
Any help on implementing this would be great. I this its got to be in handlePan or setFrame. Ill keep playing around with it, to see if i can get it on my own.
Last comment, I promise, everything else is perfect.
I have a UITableView with a UISearchBar, and a UIRefreshControl. My goal is to add this GTScrollNavigationBar (with the addition of a sub menu Issue #1 ). When the search bar is visible by default, there are no issues. But when the search bar is set to be hidden by default it screws things up.
Start by modifying the example by:
2.Modify DemoTableViewController.m
Run this, and everything performs as expected. Then uncomment
[self.tableView setContentOffset:CGPointMake(0,44) animated:YES];. Now, tap and hold near the bottom of the screen and drag up. Instead of the the menu scrolling out of view, it will almost disappear, and then snap back to normal height. It will continue this snapping until you remove your finger from the screen.Any help on implementing this would be great. I this its got to be in
handlePanorsetFrame. Ill keep playing around with it, to see if i can get it on my own.