I have created an iPhone UI programmatically but I just can’t figure out how to fit a view so that it doesn’t get overlapped by the TabBar. Here’s the ownership hierarchy:
– AppDelegate
- UITabBarController
- UINavigationController x
- UITableViewController
- UIViewController (with XIB)
- UIScrollViewController (in the same XIB as parent)
- UIViewController (with XIB)
- UITableViewController
- UINavigationController x
The problem is that my TabBar hides a part of my UIScrollView (and my tableviews as well, but that’s not important). I tried manipulating the scrollview content size and the view frame size but with no luck.
So far the best I could do was to add a 60px padding on the scrollview’s content size like this:
[scrollView setContentSize:CGSizeMake(self.view.frame.size.width, self.view.frame.size.height+60)];
Thanks for your help!
Sounds like you may have to make sure your scrollView’s frame is set properly first. The contentSize will determine the dimensions of the content of the scrollView. In other words how far you can scroll in each direction. Take a look at the scrollView in your nib and make sure the frame is the right size you need to fill.