Lon*_*ith 1 xcode objective-c storyboard xib ios
我创建了空的IOS项目,并希望创建UI.我搜索了有关将故事板连接到代码的信息,但没有任何关于它,只是关于xib文件.那么有可能在空项目中使用storyboard而不是xib吗?如何?
假设您已经在项目中有一个Storyboard文件,您可以获得这样的storyboard对象
UIStoryboard *storyBoard = [UIStoryboard storyboardWithName:@"Main_iPhone" bundle:[NSBundle mainBundle]];
YourViewController *yourVC = [storyBoard instantiateViewControllerWithIdentifier:@"identifier"];
//Do whatever with the viewcontroller object
[self.navigationController pushViewController:yourVC animated:YES ];
Run Code Online (Sandbox Code Playgroud)
注意:

| 归档时间: |
|
| 查看次数: |
5653 次 |
| 最近记录: |