Domanda

I'm developing a new application to ios and i'm using UINavigationController. When i'm developing in the Xcode the view is that:

enter image description here

But in the simulator (iOS 7) this is the result:

enter image description here

And when i use iOS 6 in the simulator, this is the result:

enter image description here

This is my code for use UINavigationController:

RootController *controller = [[RootController alloc]init];
UINavigationController *navController = [[UINavigationController alloc]initWithRootViewController:controller];
self.window.rootViewController = navController;
È stato utile?

Soluzione

As already pointed out, a straightforward solution is adding this snippet in your viewController's viewDidLoad:

if ([self respondsToSelector:@selector(setEdgesForExtendedLayout:)]) { // if iOS 7
    self.edgesForExtendedLayout = UIRectEdgeNone; //layout adjustements
}

Altri suggerimenti

You need to set Delta of your view controller. Switch Story board to ios6.1 or later from utility area (1st item). Then select view of your Vc and in size inspector menu in utility area there will be delta section below frame. There will be triangle before every delta. Triangle y to 64 (you should be on ios6.1 or later of your storyboard).

If you need help on Deltas visit : Interface Builder: What are the UIView's Layout iOS 6/7 Deltas for?

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top