views:

61

answers:

1

Hi,

My application creates two views:

  • topView (CGRect = 0,0, 320,60)
  • bottomView (CGRect = 0,60, 320,480)

Bottom view creates UITabBarController with UIViewControllers:

  • ListViewController
  • etc...

ListViewController has own views that are created in viewDidLoad method:

background = [[UIImageView alloc] initWithFrame: rect ];

So my question is how to get the bottomView rect inside ListViewController? I want to layout all controller views without intersection with topView.

Thank you.

+2  A: 

Might I suggest you read the HIG. Spend a lot of time there as it will answer many design questions that your question shows you don't yet grasp. If you're not able to lay things out with standard controls and positions, you're probably going about it the wrong way.

That being said, your question in the content of your post seems to diverge from the title. If you simply want the parent view's rectangle, use:

CGRect parentRect = [[[self view] superview] frame];

in your view controller.

And when you say ListViewController, is this a view controller you created yourself, one you got from a library somewhere, or do you mean UITableViewController?

I suggest you don't layout your controls with code if you can use Interface Builder instead. That's not always possible, but it's a good practice to use IB when it is.

Matt Long