iOS 删除stroryboard

Xcode移除”main.storyboard”以及”LaunchScreen.storyboard”

1、删除项目中的“main.storyboard”、“LaunchScreen.storyboard”的两个文件

这里写图片描述

2、移除“info.plist”文件中的“Launch screen interface file base name”和“Main storyboard file base name”两个节点

这里写图片描述

3、编辑“AppDelegate.m”文件中“didFinishLaunchingWithOptions”

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
    // Override point for customization after application launch.
    self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
    YourViewController *yourVC = [[YourViewController alloc] init];
    UINavigationController *loginNav = [[UINavigationController alloc] yourVC];
    self.window.rootViewController = loginNav;
    [self.window makeKeyAndVisible];
    return YES;
}

补充:

删除完“main.storyboard”、“LaunchScreen.storyboard”的两个文件之后可能出出现屏幕上下有黑边的情况,出现这种情况有一下两种解决办法

第一种:只删除“main.storyboard”文件,保留“LaunchScreen.storyboard”
第二种:在“Assets.xcassets”中添加“LaunchImage”(如果之前有的话,则不用添加),然后在“LaunchImage”加入对应的图片:
  • iPhone 4s (retina @2x) 640 x 960
  • iPhone 5 (@2x): 640 x 1136
  • iPhone 6 (@2x): 750 x 1334
  • iPhone 6 Plus (@3x): 1242 x 2208
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值