On ios7, Spotify Login with Facebook View shown below Navigation Item

220 views Asked by At

So, I have this problem, basically the view controller appears below the navigation controller. This happens a lot in iOS 7, however, in this case I haven't been able to fix it with just self.edgesForExtendedLayout = UIRectEdgeNone, because I don't know for which view controller I should set this.

How could I solve this?

Thanks.

enter image description here

2

There are 2 answers

0
Alex On BEST ANSWER

Solved it. Create a viewWillAppear method in SPLoginViewController.m like so:

- (void)viewWillAppear:(BOOL)animated {
        [super viewWillAppear:animated];

        UIViewController *internalLoginViewController = [[self viewControllers] objectAtIndex:0];
        if (internalLoginViewController && [internalLoginViewController respondsToSelector:@selector(edgesForExtendedLayout)])
        {
            [internalLoginViewController setEdgesForExtendedLayout:UIRectEdgeNone];
        }
}

Apparently the view controller we want to target is the one at index 0 in the UINavigationController's view controllers (SPLoginViewController is a UINavigationController).

4
Shabir jan On

By unchecking this in the viewcontroller property enter image description here

just uncheck the Adjust Scroll View Insets and it will work fine.

Update: Use this if you are not using xib/storyboard

self.edgesForExtendedLayout=UIRectEdgeNone;
self.extendedLayoutIncludesOpaqueBars=NO;
self.automaticallyAdjustsScrollViewInsets=NO;