zoukankan      html  css  js  c++  java
  • 修改XCode默认工程为使用Xib

    概述
    自从XCode5开始,当创建一个带有View的iPhone项目时,默认采用了StoryBoards,本文主要是讲解如何手动修改使其切换到使用xib来布局。

    修改步骤
    1.先将Main.storyboard从项目中移除(也可以直接删除)
    2.添加一个View的控制器,并选中使用xib,可以命名为VC
    3.修改
    AppDelegate中的didFinishLaunchingWithOptions:(NSDictionary*)launchOptions函数的代码,如下

        MainVC *vc = [[MainVC alloc]initWithNibName:@"MainVC" bundle:nil];
        UINavigationController *nav = [[UINavigationController alloc]initWithRootViewController:vc];
        self.window.rootViewController = nav;
        
        [self.window makeKeyAndVisible];
    
  • 相关阅读:
    服务器搭建Git
    BGP协议详解
    以太坊
    燃 * & *
    UML类图解析
    day8.文件操作
    python面试题汇总
    day5.字典
    day5.类型汇总
    day3,4总结程序
  • 原文地址:https://www.cnblogs.com/sanghg/p/4845046.html
Copyright © 2011-2022 走看看