ios - Gap above UISearchBar using UISearchController -


i'm experiencing odd behavior uisearchbar in ios. search bar working fine:

good uisearchbar

but when set uinavigationbar.appearance().translucent = false in applicationdelegate's didfinishlaunchingwithoptions colors right in navigation bar in ios app, search bar gets white section above this:

broken uisearchbar

when scrolling results table view, underlying content visible in gap:

broken uisearchbar translucent

the closest i've gotten fixing it, setting mysearchresultsviewcontroller.edgesforextendedlayout = uirectedge.none, stopped translucent gap, still doesn't have right color:

broken uisearchbar edgesforextendedlayout none

is there can prevent showing discolored gap , still have globally opaque navigation bars?

after googling, found following answer buried in search results: uisearchcontroller doesn't work non-translucent uinavigationbar

specifically, snippet worked when put in presenting view controller:

func viewdidload() {     extendedlayoutincludesopaquebars = true } 

so simple, yet difficult guess.


Comments

Popular posts from this blog

php - regexp cyrillic filename not matches -

c# - OpenXML hanging while writing elements -

python - Scapy Dot11ReassoReq -