作者热门文章
- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我正在使用 https://github.com/jonkykong/SideMenu它工作正常,但是,我想覆盖堆栈。
比如我有下一个流程?:
HomeViewController
> MyBusinessViewController
> TheBusinessXViewController
> Add CategoryViewController
> MyBusinessViewController
(再次).
但是,当我返回到 MyBusinessViewController
时,后退按钮
正在重定向到之前的 ViewController
,但我想删除所有堆栈并在那里有初始菜单(就像 HomeViewController
)这可能吗?
拥有更自然的行为。
最佳答案
要将 Add CategoryViewController
排除到流程中,我们需要考虑以下几点:在 Add CategoryViewController
完成后,您想要:HomeViewController
> MyBusinessViewController
> TheBusinessXViewController
TheBusinessXViewController
将是要显示的 Controller ,然后:
let nextVC = self.storyboard?.instantiateViewController(withIdentifier: "TheBusinessXVC") as! TheBusinessXViewController
nextVC.id = self.idtruck
nextVC.extraparameter = "StringOrInt"
let newViewController = self.storyboard?.instantiateViewController(withIdentifier: "HomeVC") as! HomeViewController
let sencondViewController = self.storyboard?.instantiateViewController(withIdentifier: "MyBusinessVC") as! MyBusinessViewController
let customViewControllersArray : NSArray = [newViewController, sencondViewController, nextVC]
self.navigationController?.viewControllers = customViewControllersArray as! [UIViewController]
self.navigationController?.pushViewController(nextVC, animated: true)
关于ios - 侧边菜单覆盖特定情况下的后退按钮,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46896879/
我正在创建自己的网站。使用无序列表制作我自己的标题 + 导航栏。 我遇到的问题是标题没有延伸到浏览器的边缘。唯一可行的方法是在 css“header”中使用。 position:absolute; 我
我是一名优秀的程序员,十分优秀!