SplitViewController
能够在一个TabBarController
中显示。不幸的是,我最初决定只使用一个SplitViewController
并选择了苹果的模板。现在我处于不方便的位置,不知道如何将其添加到选项卡栏中。我尝试了一些在StackOverflow上解释过的方法,但最好的结果是一个黑屏和下面的选项卡栏 :-(
我只是在努力寻找一种简单明了的方法。
我的
Appdelegate
代码:- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
// Override point for customization after application launch.
// Add the split view controller's view to the window and display.
self.window.rootViewController = self.splitViewController;
[self.window makeKeyAndVisible];
NSArray *searchPaths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
documentFolderPath = [searchPaths objectAtIndex: 0];
self.rootViewController.directoryPath = documentFolderPath;
NSURL *docUrl = [launchOptions objectForKey:UIApplicationLaunchOptionsURLKey];
if ([docUrl isFileURL]) {
NSString *path = [docUrl path];
self.detailViewController.currentFilePath = path;
[self.detailViewController setDetails:path newFile:FALSE];
}
return YES;