简体   繁体   中英

Create space between navigationbar and searchBar because of UI design

I have an app where the navigationBar is implemented according to Apple HIG, so 44px high. Thereunder is a searchBar which is directly under the navigationBar.

The guy designing my app now has created an custom image for the navigationBar which is 64 px high. I already cut the image so that the actual height of the navbar image is 44 px. And added the rest of the image to the tableView background image. Everything is implemented and works correctly except that now my searchBar is scrolling through my navigationBar IMAGE. So technically it is not in the navBar but from a UI design standpoint it is.

I cannot seem to find out how to make sure the space directly under the navigationBar (20px) is not used. It should look as if the navigationBar is 20px bigger to the user.

Hopefully someone can guide me in the right direction, thanks!

I think you have your search bar nested in a UITableView right? You can change your view controller to a subclass of UIViewController instead of a UITableViewController , and then you will be able to add the table view to the controller's view manually and adjust its size whatever way you want.

(Don't forget to let your controller implement data source and delegate protocols and hook it up with your table view.)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM