0

Can anyone help me with this?

I am looking to place a searchBar inside of a navigationBar, but under the Title (reason for doing so is that I would like one image for the NavigationBar & SearchBar) Having issues with the <= 1px shadow from NavigationBar. I have accomplished putting the searchBar inside the NavigationItem "Title" but I want it to be below it. Here is what I'm using to put the searchBar inside the NavBar:

func createSearchBar()
{
    let searchBar = UISearchBar()
    searchBar.showsCancelButton = false
    searchBar.placeholder = "Search"
    searchBar.delegate = self
    self.navigationItem.titleView = searchBar
}
rmaddy
  • 314,917
  • 42
  • 532
  • 579
David Henry
  • 1,972
  • 20
  • 43

1 Answers1

0

You need to add a custom view to your navigation bar an center that view.

Maybe this can help you:

Can't set titleView in the center of navigation bar because back button

Or creating a custom nav bar:

https://www.codeschool.com/blog/2014/11/11/ios-app-creating-custom-nav-bar/

Community
  • 1
  • 1
Gabriel Goncalves
  • 5,132
  • 3
  • 25
  • 34