0

I use some classical UInavigationBar and UISearchController at head of a UICollectionView. My searchController is sticked to my navigationBar as I can scroll into my collectionView and use my searchController at any moment.

I'd like to know if there is a way to add space between my UInavigationBar and UISearchController as described in screenshot below : enter image description here

Creanomy
  • 216
  • 2
  • 12

1 Answers1

0

You can adjust this in your storyboard if you have one, just select your searchbar and define constraints with the constraint icon (it looks like a square with two bars on each sides). Tell me if you still have the problem.

Abv
  • 354
  • 2
  • 13
  • I'm doing it programmatically :( – Creanomy Mar 09 '21 at 19:00
  • Can you post your code? It should include your view controller class where you have your navigation bar and searchbar defined – Abv Mar 09 '21 at 21:56
  • I think I found another solution... instead of trying modify build-in swift components and add too many constraints for a same behaviour, I prefer try this : https://stackoverflow.com/questions/48377722/use-background-image-on-uisearchcontroller-ios-11/48444177 – Creanomy Mar 10 '21 at 09:57