当前位置: 首页 > news >正文

wordpress 安全防护网站页面设计优化方案

wordpress 安全防护,网站页面设计优化方案,企业解决方案中心,手机提取网页视频【iOS】present和push present和push的比较 present和push都用于iOS的视图切换#xff0c;并且切换都是可逆的#xff0c;原始视图不会被销毁#xff0c;还可以直接更改window的rootViewController来切换视图#xff0c;但是这种方法不可逆#xff0c;并且原始视图会被销毁…【iOS】present和push present和push的比较 present和push都用于iOS的视图切换并且切换都是可逆的原始视图不会被销毁还可以直接更改window的rootViewController来切换视图但是这种方法不可逆并且原始视图会被销毁 present一般用于不同业务界面的切换push一般用于同一业务不同界面的切换 present和dismiss对应push和pop对应 present只能逐级返回push有栈控制但是可以返回任意级 ? push方法 SecondViewController* secondViewController [[SecondViewController alloc] init]; [self.navigationController pushViewController:secondViewController animated:YES]; pop方法 //返回上一级视图 [self.navigationController popViewControllerAnimated:YES]; //返回根视图 [self.navigationController popToRootViewControllerAnimated:YES]; //返回指定级数 [self.navigationController popToViewController:[self.navigationController.viewControllers objectAtIndex:0]]; 这里返回到指定级数的方法是通过访问视图控制器属性来获得视图控制器数组在这个数组中可以获得导航控制器的每一层视图再调用popToViewController方法就可以回到指定级数的视图。 present方法 SecondViewController* secondViewController [[SecondViewController alloc] init]; [self presentViewController:secondViewController animated:YES completion:nil]; dismiss方法 [self dismissViewControllerAnimated:NO completion:nil]; dismiss多级的方法 两个属性 在讲解dismiss多级视图控制器的方法之前先来了解一下presentedViewController和presentingViewController这两个UIViewController的属性。 presentedViewControllerThe view controller that was presented by this view controller or its nearest ancestor. 由这个视图控制器或它最近的祖先呈现的视图控制器 presentingViewControllerThe view controller that presented this view controller (or its farthest ancestor.) 呈现此视图控制器(或其最远祖先)的视图控制器。 举个例子如果B控制器是由A控制器present弹出的那么 A.presentedViewController B; B.presentingViewController A; dismiss多级 现在来实现A、B、C、D四个视图控制器通过dismiss来实现多级之间的跳转。假设A、B、C、D四个视图之间的跳转关系为A-B-C-D 由D视图dismiss到A视图 UIViewController *rootViewController self.presentingViewController; while (rootViewController.presentingViewController) {rootViewController rootViewController.presentingViewController; } [rootViewController dismissViewControllerAnimated:YES completion:nil]; dismiss两级 [self.presentingViewController.presentingViewController dismissViewControllerAnimated:YES]; 也可以向前遍历来访问要dismiss的视图 UIViewController *ViewController self.presentingViewController; while (![ViewController isKindOfClass:[SecondViewController class]]) {ViewController ViewController.presentingViewController; } [ViewController dismissViewControllerAnimated:YES completion:nil]; 注意 这里的dismiss与我们以前常用的dismiss用法不同以前都是被切换出的视图控制器调用dismiss方法来回到上一级视图控制器。而这里却是要回到哪一级视图控制器就哪一级视图控制器调用dismiss方法。 那么dismissViewController到底在哪里执行呢 其实如果由A跳转到BpresentViewController方法在A里面执行而dismissViewController也是A视图控制器来调用 苹果文档里的一段话 The presenting view controller is responsible for dismissing the view controller it presented. If you call this method on the presented view controller itself, it automatically forwards the message to the presenting view controller. 翻译如下 呈现视图控制器负责解散它呈现的视图控制器。如果你在被呈现的视图控制器本身上调用这个方法它会自动将消息转发给呈现的视图控制器。 什么意思呢 其实就是如果在B中调用dismiss方法dismiss方法会自动交给B的presentingViewController也就是AViewController来执行。 //在B中返回上一级 [self dismissViewControllerAnimated:NO completion:nil]; [self.presentingViewController dismissViewControllerAnimated:NO completion:nil]; //这两种写法效果一致 对于在A中执行dismiss从而实现多级跳转到A的解释如下 苹果文档里的解释 If you present several view controllers in succession, thus building a stack of presented view controllers, calling this method on a view controller lower in the stack dismisses its immediate child view controller and all view controllers above that child on the stack. When this happens, only the top-most view is dismissed in an animated fashion; any intermediate view controllers are simply removed from the stack. The top-most view is dismissed using its modal transition style, which may differ from the styles used by other view controllers lower in the stack. 翻译如下 如果你连续展示多个视图控制器从而构建了一个由被展示的视图控制器组成的堆栈那么在堆栈中较低位置的视图控制器上调用这个方法会解除其直接子视图控制器以及该子视图控制器上方堆栈中的所有视图控制器。当这种情况发生时只有最顶层的视图是以动画方式被解除展示的任何中间的视图控制器都会直接从堆栈中移除。最顶层的视图使用其模态过渡样式来解除展示该样式可能与堆栈中较低位置的其他视图控制器使用的样式不同。 也就是说当present多个视图控制器时系统维护了一个栈栈中存放着A、B、C、D四个视图控制器。当在A中执行dismiss方法栈中在A之上的视图就会被dismiss掉不同的是栈顶视图会以动画形式dismiss而中间的视图控制器只是简单地remove掉。
http://www.dnsts.com.cn/news/259272.html

相关文章:

  • 站长查询seo是什么意思信息化系统的应用场景
  • 做兼职编辑的网站网站搭建网
  • 做的好的阅读类的网站有哪些深圳工程交易网
  • 成都建设厅官方网站做网站包含微信公众号吗
  • 宝应县城乡建设局网站wordpress内链
  • 建设公司官方网站网站建设费用能否计入广告费
  • 大型网站如何优化用phpmysql做网站
  • 泰安中呼网站建设有限公司 概况高端网站设计开发
  • 南京网站建设 w网站开发的好处和弊端
  • 怎么做网站静态布局装饰公司资质
  • 青岛百度网站排名京东网站的建设与发展
  • 临沂网站建设搭建网站都要交域名费么
  • 网站建设维护管理办法网线制作口诀
  • 泰安网签成交量最新九江seo优化
  • .net电商网站开发长春火车站到长春机场大巴时刻表
  • 怎么做信息发布型网站做彩票网站是违法
  • WordPress完美建站长春网站制作哪里好
  • 吴江网站建设杭州网站建站
  • php网站301重定向wordpress 缩略图插件
  • 做外贸选取哪个网站wordpress直链视频
  • 网站推广基本预算东莞专业做网站的公司
  • 做袜子娃娃的网站做网站的技术员
  • 电子商务网站开发的基本流程百度seo网站优化怎么做
  • 建设银行+贷款+查询+网站如何免费制作一个网站
  • 做网站属软件什么专业做公益做的好的的网站
  • 做个网站每年都要交域名费吗品牌厂家网站建设
  • 中国建设银行安徽省招聘信息网站福州专业做网站
  • 网站系统发生错误h5网站制作平台有哪些
  • 网站如何清除百度收录诚信网站的申请有几家公司可以做的
  • 云南装饰公司做网站免费做会计试题网站