Swift 学习笔记(三)删除 Main.storyboard 和 LaunchScreen.storyboard

来源:互联网 发布:ipad翻墙用什么软件 编辑:程序博客网 时间:2024/05/29 18:53

第一步:

  • 右键选中Main.storyboard —- delete —— Move to Trash
  • LaunchScreen同理

第二步

  • 点击工程名,就是最顶级目录
  • 右侧出现general选项卡
  • 将Deployment info组内的Main Interface设为空
  • 将App Icons and Launch Images 组内的 Launch Images Source设置为资源文件
    (这一步很重要,如果不设置启动页,上下就会出现黑边,无法适配iPhone5等大屏幕)

第三步

  • 打开info.plist,删除Launch screen interface file base name 和 Main storyboard file base name选项。

第四步

  • 指定第一个页面
  • 打开AppDelegate.swift
  • 在application方法中自定义

例如

func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool {        // Override point for customization after application launch.        window = UIWindow(frame: UIScreen.mainScreen().bounds)        window?.backgroundColor = UIColor.whiteColor()        window?.rootViewController = ViewController()        window?.makeKeyAndVisible()        return true    }
1 0
原创粉丝点击