I'm working on a feature that has custom view above UITableView, it looks like TableView has contentInset. I added SearchController to a TableViewHeader, but when I tap on searchTextView SearchController moves up with animation (about 20px). I want that UISearchBar will be at the top of ViewController like in "Constacts"
This screenshot shows how it's now:
this one is how I want:
What should i do? I need contentInset after searching (user tapped on cancel), but during the searching I do not need it.
I want to provide app example, that demonstrates all this stuff -> enter link description here
If you are using storyboards You should click on the view controller or TableView Controller which you have set up for your tableview and go to its attribute inspector and look under ViewController section and check the Extend Edges section to be under Top Bars.
**OR**
Check both Under Top Bars and Under Opaque Bars and leave Under Bottom Bars unchecked.
Do this :
OR DO this :
Try playing with Adjust Scroll View Insets
, Under Top Bars
, and Under Bottom Bars
in the interface builder. I had the same issue with a collectionView and toggling them off worked for me. You example project works for me but when I toggle between those settings it breaks.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With