0

SplitView次のようにアプリに実装しました。

AppDelegate.h

@property (nonatomic, strong) IBOutlet UISplitViewController *splitViewController;

AppDelegate.m

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
     LeftsideViewController *masterViewController = [[LeftsideViewController alloc] initWithNibName:@"LeftsideViewController" bundle:nil] ;
    UINavigationController *masterNavigationController = [[UINavigationController alloc] initWithRootViewController:masterViewController] ;

    HomeViewController *detailViewController = [[HomeViewController alloc] initWithNibName:@"HomeViewController_iPad" bundle:nil];
    UINavigationController *detailNavigationController = [[UINavigationController alloc] initWithRootViewController:detailViewController];
    masterViewController.homeViewController = detailViewController;

    self.splitViewController = [[UISplitViewController alloc] init] ;
    [self.splitViewController.view setBackgroundColor:[UIColor blackColor]];
    self.splitViewController.delegate = detailViewController;
    self.splitViewController.viewControllers=[NSArray arrayWithObjects:masterNavigationController,detailNavigationController,nil];

    self.window.rootViewController = self.splitViewController;
     NSLog(@"VIEWs %@",[self.window subviews]);
    [self.window makeKeyAndVisible];

    return YES;
}

問題

iOS6で問題なく動いています。

しかし、ios 7 では、私が含めなかったいくつかのビューが表示されます。私の次の画像とを参照してくださいextra view is in Pink Colorここに画像の説明を入力

4

1 に答える 1

0
float systemversion=[[[UIDevice currentDevice]systemVersion]floatValue];

    if(systemversion>=7.0f)
    {

        self.edgesForExtendedLayout=UIRectEdgeNone;
    }

このコードを試してください

于 2013-10-10T11:22:00.297 に答える