有时候,我们的Controler中包含有另一个controler view的view时,可以使用这种方式。

https://developer.apple.com/library/ios/featuredarticles/ViewControllerPGforiPhoneOS/ImplementingaContainerViewController.html

把一个controller view 加入到 controler中

 [self addChildViewController:content];  //1
content.view.frame = [self frameForContentController];
[self.view addSubview:self.currentClientView]; //2
[content didMoveToParentViewController:self]; //3

移除一个controller view

 [content willMoveToParentViewController:nil]; //1
[content.view removeFromSuperview]; //2
[content removeFromParentViewController]; //3

  

Container View Controller的更多相关文章

  1. iOS Container View Controller

    一.UIViewController 做iOS开发的经常会和UIViewController打交道,从类名可知UIViewController属于MVC模型中的C(Controller),说的更具体点 ...

  2. iOS 容器控制器 (Container View Controller)

    iOS 容器控制器 (Container View Controller) 一个控制器包含其他一个或多个控制器,前者为容器控制器 (Container View Controller),后者为子控制器 ...

  3. 《iOS Human Interface Guidelines》——Container View Controller

    容器视图控制器 容器视图控制器管理和展示它的子视图集合--或者子控制器集合--以一种自己定义的方式. 系统定义的容器视图控制器的样例有标签栏视图控制器.导航栏视图控制器和分栏视图控制器(查看Tab B ...

  4. 【IOS笔记】View Controller Basics

    View Controller Basics   视图控制器基础 Apps running on iOS–based devices have a limited amount of screen s ...

  5. View Controller 视图管理总结

    View controller是iOS中顶层的视图载体和控制器,它需要对view负责,管理view的生命周期,相关处室话以及交互事件,除此以外还需要为view提供合适的数据,以供view使用. Vie ...

  6. View Controller Programming Guide for iOS---(七)---Resizing the View Controller’s Views

    Resizing the View Controller’s Views A view controller owns its own view and manages the view’s cont ...

  7. View Controller Programming Guide for iOS---(六)---Responding to Display-Related Notifications

    Responding to Display-Related Notifications 响应跟显示相关的通知 When the visibility of a view controller’s vi ...

  8. View Controller Programming Guide for iOS---(四)---Creating Custom Content View Controllers

    Creating Custom Content View Controllers 创建自定义内容视图控制器 Custom content view controllers are the heart ...

  9. View Controller Programming Guide for iOS---(三)---Using View Controllers in Your App

    Using View Controllers in Your App Whether you are working with view controllers provided by iOS, or ...

随机推荐

  1. Eclipse 修改debug当前行的颜色

    window --preferences--general--editors--text editors--annotations--debug current instruction pointer

  2. linux系统更改目录和文件的权限总结

    对于属于你的文件,可以按照自己的需要改变其权限位的设置.在改变文件权限位设置之前,要仔细地想一想有哪些用户需要访问你的文件(包括你的目录).可以使用c h m o d命令来改变文件权限位的设置.这一命 ...

  3. python类的简单介绍

    类是面向对象编程的核心, 它扮演相关数据及逻辑的容器角色.它们提供了创建“真实”对象(也就是实例)的蓝图.因为Python 并不强求你以面向对象的方式编程(与Java 不同), 此刻你也可以不学习类. ...

  4. 用xshell操作linux系统的常用命令

    (1)命令ls——列出文件 ls -la 给出当前目录下所有文件的一个长列表,包括以句点开头的“隐藏”文件 ls a* 列出当前目录下以字母a开头的所有文件 ls -l *.doc 给出当前目录下以. ...

  5. PHP读取Mongodb数据报错,Cannot natively represent the long 8331412483000 on this platform

    在使用PHP进行读取Mongo数据时,如果读取的int数据过大时,会自动转变为int64位. 并会报以下错误: Cannot natively represent the long 833141248 ...

  6. HTML 空格的表示符号 nbsp / ensp / emsp 的区别?

      半角的不断行的空白格(推荐使用)   半角的空格   全角的空格   半角的不断行的空白格(推荐使用)    半角的空格     全角的空格

  7. 第一篇 ERP是什么?-从道的层面浅谈我的理解

    世界上称为ERP软件的软件很多,国外的有SAP,ORACLE,国内的有金蝶,用友,浪潮.这些由不同的厂商开发制作的软件总有其软件适用的场合.这个场合就是企业,而且是市场经济中的企业.个人是不会购买ER ...

  8. Asp.Net使用代理IP远程获取数据

    /// <summary> /// 远程获取数据 /// </summary> /// <param name="url">url</pa ...

  9. Python [Leetcode 350]Intersection of Two Arrays II

    题目描述: Given two arrays, write a function to compute their intersection. Example:Given nums1 = [1, 2, ...

  10. kdtree备份

    库在这里 这个很好用. 例子: /*! gcc -Wall -g -o test test.c libkdtree.a */ #include <stdio.h> #include < ...