问题
I use:
self.navigationController?.navigationBar.shadowImage = UIImage()
to remove the border of a navigationBar earlier in my app but now I'm not sure to add the border back on a later screen.
回答1:
To reset the navigationBar
's shadowImage
to the default shadowImage
do the following:
self.navigationController?.navigationBar.shadowImage = UINavigationBar().shadowImage
来源:https://stackoverflow.com/questions/57401651/how-to-add-a-border-to-swift-navigationbar-after-removing-it