why UIScrollView is leaving space from top in ios 6 and ios 7

Update for iOS 11

if #available(iOS 11.0, *) {
    scrollView.contentInsetAdjustmentBehavior = .never
} else {
    automaticallyAdjustsScrollViewInsets = false
}

In Xcode 5, in storyboard select your controller > in Attribute Inspector disable Adjust Scroll View Insets Also check if you have set any contentInset

Edit : I attached a pic

enter image description here


Inspector: Select scrollView and set up Content Insets - never

enter image description here


The fix is to implement the following line of code after in the viewDidLoad;

self.automaticallyAdjustsScrollViewInsets = NO;