UIScrollView does not scroll after unchecking "Adjust scroll inserts" xcode 6

In my application, I tried using scroll. But I ran into a problem when the scrollbar displays the space above and below, as indicated in the next question.

ScrollView adds space at the top of subview xcode 6 Swift

I was asked to uncheck the "Configure Scroll Inserts" checkbox of the containing view controller. Doing this decided my goal.

But the scroll view no longer scrolls. I cannot scroll to the views that appear below.

Can I find out what I need to do to make it work? Thanks.

+6
source share
3 answers

As I decided, the extra addition between the top label and the navigation bar was removed from the โ€œUnder Top Barsโ€ mark in the attribute inspector in the โ€œAdvanced Edgesโ€ section. When you uncheck the box, items on your storyboard can move around. Do not reinstall them. Run the simulator and it should work.

Note. Check "Customize scroll", otherwise nothing scrolls.

My attributes:

enter image description here

+4
source

I had exactly the same problem. Here's how it worked for me. I added a screenshot of my object hierarchy

  • Turn off the scroll setting.
  • Drag the view and place it in your scroll view, cover the entire storyboard. This view will contain every user interface object in your storyboard.
  • Add top, right, bottom, left = 0 constraints from your scroll view to the main view.
  • Add upper, right, lower, left, and lower level constraints from the content view to the Main View.
  • Add restrictions from your user interface object regarding your content.

ImageView is located under the navigation bar. The top, right, left limits are 0 relative to the presentation of the content. When I launch the application, my image appears right below the navigation bar.

enter image description here

0
source

Define in viewDidLoad

self.automaticallyAdjustsScrollViewInsets = false 
-2
source

Source: https://habr.com/ru/post/979881/


All Articles