现在的位置: 首页 > 综合 > 正文

ios view controller 加载 卸载view的过程

2018年01月08日 ⁄ 综合 ⁄ 共 355字 ⁄ 字号 评论关闭
加载过程
ios view controller 加载 卸载view的过程 - 踏风追燕 - 我的博客

 

卸载view过程
ios view controller 加载 卸载view的过程 - 踏风追燕 - 我的博客

 

下面是用代码加载view的示例代码

- (void)loadView
{
    CGRect applicationFrame = [[UIScreen mainScreen] applicationFrame];
    UIView *contentView = [[UIView alloc] initWithFrame:applicationFrame];
    contentView.backgroundColor = [UIColor blackColor];
    self.view = contentView;
 
    levelView = [[LevelView alloc] initWithFrame:applicationFrame viewController:self];
    [self.view addSubview:levelView];
}

抱歉!评论已关闭.