scrollViewWillBeginDragging in UITableView does not work - ios

UIScrollView|
UITableView
I have 5 UITableView in UIScrollView.
My program has a Navigation Controller inside TabbarController.
When I run the program, everything is OK. It can drag up and down to refresh data in tableview. It can drag left and right to change tableview.
But when I push the button on the Navigation Bar, it will push a view.
Then I push the back button on the navigation bar on this view.
The scrollViewWillBeginDragging in UITableView not worked. I can just receive the scrollViewWillBeginDragging in UIScrollView.
More worse, it can drag all directions.
Why?

already fix this bug , set self.automaticallyAdjustsScrollViewInsets = NO;

Related

tableHeaderView preserves state when popping viewController except ContainerViewController

I have a tableViewController with a tableHeaderView. When I'm at the top of the tableView and I scroll the tableView up slightly the tableHeaderView is hidden and can reappear again by scrolling down slightly. This is the default behaviour.
When I push to a viewController then pop back to the tableViewController, the state of the tableHeaderView is preserved. i.e., if it was hidden it remains hidden and if it was visible it remains visible.
However, for some reason when I push to another viewController that has a containerView and then pop back, the tableHeaderView always displays. Even if it was hidden before pushing.
The Issue was that I had checked Hide Bottom Bar On Push in storyboard on the viewController that I was pushing to. For some reason this caused the tableHeaderView to always display when popping back. Unchecking this fixed the problem. Instead the tabBar can be hidden in viewDidLoad of the pushed viewController with the following:
self.tabBarController?.tabBar.isHidden = true
Hope this will help somebody.

TableView Scrolls Over NavBar

When I scroll my TableView, it scrolls over my navigation bar (which I made without using the built in navigation bar for various reasons). See below:
Unscrolled:
Scrolled up:
How do I make it so that the TableView scrolls under the Navbar?
SOLVED:
I checked the "clips subviews" box for the table view to fix this problem.
To me, it looks like there may be an issue with your view hierarchy. Now, I assume that you built your own navigation bar by subclassing UINavigationBar.
In order to get the kind of behavior you need, you should have the following:
UIWindow's rootViewController is an instance of UINavigationController.
UINavigationController.navigationBar = your subclass of UINavigationBar.
UINavigationController.viewControllers[0] = UITableViewController
The UITableViewController.view = your UITableView

TabBar hopelessly covering my ContainerView

I have a custom UIContainerView. Inside the UIContainerView is a Controller with a UITableView. The TabBar keeps covering the last cell of my TableView. How do I prevent that from happening? I already tried the suggestions at TableView Showing Behind Tab Bar and Tab Bar covers TableView cells in iOS7 and Tab bar covers UITableView's last cell at all levels: in the VC holding my container view and in the VC of the TableView, as appropriate. I am not having much success. I set the constraints, I remove constraints — still nothing. Help!
I am using iOS7 and Xcode5.

UIButton stays highlighted until UITableView ends scrolling

I have my own custom navigation controller(that subclasses UIViewController) that has a stack for the view controllers. It has a custom navigation bar and a content view, where I add the view of the view controller at the top of my stack of view controllers.
Then navigation bar, which is a subclass of UIView, I didn't subclass UINavigationBar, because I don't need to, has a Back button, and another button which at this moment doesn't have any action connected.
My problem is that if I scroll a UITableView (that belongs to the current view controller on the stack) and I press either on my back button or on the other button, both of them stay highlighted until the UITableView ends scrolling. It's the weirdest behavior ever, and I don't understand why it happens.
Any suggestions please?
Apparently, if I call [button setHighlighted:NO] on my IBAction it de-highlights it even if the UITableView is still scrolling

UITableView scroll to top when tapping status bar at top of the screen

I inserted a UITableView inside another UIViewController's view.
but when I tap the status bar at the top of the screen; the table view doesn't scroll to the top which is the expected behavior within iOS apps.
I tried :
[self.tableView setScrollsToTop:YES];
but the tableview still not scroll to top when tap the top of the screen.
You have to set scrollsToTop to NO on all the other scroll views in your hierarchy. If more than one scroll view has scrollsToTop set to YES, none of them will scroll to top when the status bar is touched. This is mentioned in the documentation of the scrollsToTop property.
Keep in mind that this also applies to any subclasses of UIScrollView in your view hierarchy, and that UITableView, UIContainerView, and UITextView are subclasses of UIScrollView.
Thanks for all,
i resolved this problem by removing all other UITableView from the parent ViewController, and then auto scroll to top was working for this UITableView..
thanks

Resources