views:

2088

answers:

1

HTF?

i'm new to the iphone SDK. for a navigationbar and uitable (from the NIB) eg. an empty/new navigation-based app, what is the best way to change the height of the uinavigationbar without it clipping/overlapping the uitableview? i essentially just need to move the uitableview down and i've tried just about everything now.

Q1) is it best to use eg. navigationBar.frame = CGRectMake(0, 20, 320, 88); or should i be using navigationBar.bounds instead?

Q2) do you set tableView.bounds or .frame with CGRectMake? or is there something blatently obvious that i overlooked?

i've tried different autoresizingMask combos too

come on peoples! this should be easy. what am i doing wrong here?

+1  A: 

UINavigation has a set size - it's not easy to change, and is likely to violate Apple's HIG if you do change it.

Aside from that, I'm not entirely sure what you're asking. Is the navigation bar obscuring the top of your table view? If that is the case, simply leave a 44px space above your table view. If that doesn't work, or your table view isn't embedded in another view, you can set the contentInset property on the table view to explicitly make space between the top of the table view's scroll view to the content within the table view.

Jasarien
THANKS! that did the trick. i needed to use contentInset. i'm still unsure about which way is best to resize the navbar... navbar.frame or navbar.bounds. anyways thanks again.FYI:i'm trying to simulate the google searchbar in the mobile safari app.
hardus
Look at UINavigationItem's prompt property. That is what is used to achieve the 'larger navigation bar' in mobile safari.
Jasarien
As for when the search bar is expanded, that's likely to be a custom view. I'm not sure if you can have a navigation bar with a prompt, a button and a search field without rolling your own.
Jasarien