Xcode 9 beta 6 iOS 11
I have a storyboard for a viewController
, the background ImageView, tableView and the searchFooter view are the subViews of the view.The structure is as follows:
In the AppDelegate
class,I set
UINavigationBar.appearance().prefersLargeTitles = true
and
UINavigationBar.appearance().setBackgroundImage(UIImage(),for: .default)
UINavigationBar.appearance().shadowImage = UIImage()
In the viewController
class,I set navigationItem.searchController = searchController
and navigationItem.hidesSearchBarWhenScrolling = true
When I run the application, I found that the
shadowImage
of thenavigationBar
was still exist. The navigationBar wouldn't become normal(not the prefersLargeTitles mode ) automatically(the left gif) when I scrolled the tableView.I hope the navigationBar can work just like the system app(the right gif).
A weird behavior: When I remove the background
imageView
, it can work as well as the system app on the simulator.
I don't know why it happened,I wonder how to solve it? Thanks.