我不想使用故事板,我宁愿在需要时使用NIB来制作UI,而且我尤其不想将它们用于默认模板。
Xcode 5不再具有表明您不想使用情节提要的复选框,
有人可以帮忙吗?真烦人...
删除故事板的步骤-XCode 5(编辑)
1 /创建一个空项目
2 /使用xib为您的控制器添加新文件,如果在构建阶段未将其添加到已编译的源代码中,请手动添加。
4)更改appdelegate didFinishLaunchingWithOptions文件并添加:
self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]] ;
[self.window makeKeyAndVisible];
就像 :
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]] ;
// Override point for customization after application launch.
TestViewController *test = [[TestViewController alloc] initWithNibName:@"TestViewController" bundle:nil];
UINavigationController *nav = [[UINavigationController alloc] initWithRootViewController:test];
self.window.rootViewController = nav;
[self.window makeKeyAndVisible];
return YES;
}
删除故事板的步骤
1)从您的项目中删除Main.storyboard文件。
2)使用xib为您的控制器添加新文件,如果在构建阶段未将其添加到已编译的源代码中,请手动添加。
3)从plist中删除Main Storyboard文件的基本名称。
4)更改appdelegate didFinishLaunchingWithOptions文件并添加:
self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]] ;
[self.window makeKeyAndVisible];
就像 :
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]] ;
// Override point for customization after application launch.
TestViewController *test = [[TestViewController alloc] initWithNibName:@"TestViewController" bundle:nil];
UINavigationController *nav = [[UINavigationController alloc] initWithRootViewController:test];
self.window.rootViewController = nav;
[self.window makeKeyAndVisible];
return YES;
}
在这里看看
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句