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

前端 未结 7 1485
萌比男神i
萌比男神i 2020-12-04 08:21

\"enter

\"enter

相关标签:
7条回答
  • 2020-12-04 08:41

    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

    0 讨论(0)
  • 2020-12-04 08:44

    Update for iOS 11

    if #available(iOS 11.0, *) {
        scrollView.contentInsetAdjustmentBehavior = .never
    } else {
        automaticallyAdjustsScrollViewInsets = false
    }
    
    0 讨论(0)
  • 2020-12-04 08:49

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

    self.automaticallyAdjustsScrollViewInsets = NO;

    0 讨论(0)
  • 2020-12-04 08:49

    Go to main storyboard. Select view controller, see property "Adjust Scroll view Insects" in attribute inspector. if you do not want top spacing.then uncheck "Under Top Bars". if you don not want bottom spacing.then uncheck "Under Bottom Bars". this kind of problem come when we use scroll view related controllers.

    This is a feature for navigation and tab bar to adjust content in scroll view like controls.

    0 讨论(0)
  • 2020-12-04 08:53

    In your StoryBoard, select ContentInsets to never:

    0 讨论(0)
  • 2020-12-04 08:59

    Inspector: Select scrollView and set up Content Insets - never

    0 讨论(0)
提交回复
热议问题