I have a UITableViewController embedded in a navigation bar and standard Search bar implementation. I don't hide the navigation bar while the search bar is active. The problem is that while the search bar is active, every button in the navigation bar, like a "Back" button, should be pressed twice— the first time to make the search bar inactive. How can I avoid that? Thank you.
答案 0 :(得分:0)
在viewDidLoad
上添加此代码 self.definesPresentationContext = true
如果您的navigationBar是Opaque
,请添加此项 self.extendedLayoutIncludesOpaqueBars = true