views:

324

answers:

4

I am a working UINavigationController pushing two different UITableViews on and off the stack. All of my functionality is working correctly except scrolling. When either table is scrolled above the top row, or below the bottom row, it stays there exposing the margin above/below the table. I am looking for the table to "bounce" back so that only the table is visible and not the white space area beyond - just like any other iPhone app.

One of my UITableViews is being loaded by NIB and the other is being created programatically - both of which have the exact same result. I have tried all the bounce and scrolling settings in the Nib, but nothing seems to work.

Can someone tell me what I am doing wrong? Please let me know if I can be more specific in detailing my problem.

Thanks,

-Scott

A: 

Your UITableView is a UIScrollView, whose property bounces is the key. Here's the reference. By default it is YES, though. Did you check this one?

Kevin Conner
Yes, I checked that and it is set to YES. The docs also say that property, if set to NO, will not allow the view to be scrolled past the end of the content. In my case, it is scrolling past in both directions. Could this haves something to do with the fact that my UITableView is hooked up to a UINavigationController? Thanks...
Scott Elder
I forgot to mention, when scrolling a list of 20+ items, the scrolling is not fluid. Normally when you move you finger down fast and remove it from the screen, the scrolling continues for a few rows. in my case, the scrolling stops immediately after removing my finger no matter how fast I scrolled. Any ideas?
Scott Elder
A: 

Your question and comments seem to suggest that you are attaching a UITableView to your UINavigationController in some way other than by pushing a UITableViewController. If you're not doing it that way, you really should.

In general, if you can push a child view controller onto a UINavigationController, then you can also use the child view controller by itself just to test it out. Try making your UITableViewController's view the root view of your window, and see if that does what you expect. That way you can isolate the problem to either the table view part or the navigation part.

Kevin Conner
Kevin,I am creating a UINavigationController and attaching a UITableViewController using the Nav's initWithRootViewController.TextListViewController *controller = [[TextListViewController alloc] initWithNibName:@"TextListViewController" bundle:nil];controller.title = @"Title Text"; navController = [[UINavigationController alloc] initWithRootViewController:controller]; navController.modalTransitionStyle = UIModalTransitionStyleCoverVertical;[self sesentModalViewController:navController animated:YES]; [controller release];Is this correct? Thanks for the help.
Scott Elder
Wow, that's ugly. Not sure how to show you the code in a readable format on this forum.Thanks for any help you can provide.-Scott
Scott Elder
Hmm. It looked correct to me… Try comparing versus a new project using the navigation / table view template. It should do basically what you're trying to accomplish.
Kevin Conner
A: 
Scott Elder
+1  A: 
Scott Elder