【发布时间】:2018-11-23 18:46:56
【问题描述】:
在这里,我在主页中有导航栏,即前视图控制器,在主页中,我在导航中也有导航栏和搜索栏,点击搜索栏后,它会移动到没有任何导航的搜索页面,如果我关闭从搜索页面主页导航消失,谁能帮我在 swift 3 中从任何视图控制器返回时如何放置主页导航栏?
下面是我的图片
https://user-images.githubusercontent.com/32094391/41342703-82c64c24-6f1a-11e8-89e9-ebd35066e7d2.png
使用的代码如下所示
func searchBarTextDidBeginEditing(_ searchBar: UISearchBar) {
let storyboard = UIStoryboard(name: "Main", bundle: nil)
let abcViewController = storyboard.instantiateViewController(withIdentifier: "filterPage") as! filterPageViewController
self.navigationController?.pushViewController(abcViewController, animated: true)
}
从搜索页面返回的代码是
func searchBarCancelButtonClicked(_ searchBar: UISearchBar) {
self.navigationController?.popViewController(animated: true)
}
【问题讨论】:
-
您是否隐藏在搜索页面导航栏中的任何位置
-
是的,在搜索页面中我不需要任何导航栏,所以我隐藏了导航栏@Anbu.karthik
标签: ios swift3 uinavigationbar swrevealviewcontroller