Strange UIScrollView behavior in XCODE 8 without autorun

I just upgrade my xcode from 7.3 to 8 and come across some weird behavior for all UISrollviews. Although testing in subview mode inside the scrollview is centered on the screen, it works very well in the storyboard. I do not understand how this unexpected behavior. Please, help..

+4
source share
1 answer

You need to add another Child View with a scroll with the name (scrollContainerVw) and set the following contacts: to view the scroll and view for children.enter image description here enter image description here

If you want to support multiple screens, please add the following code in the field of view:

    self.scrollVw.frame.size.width = self.view.frame.size.width
    self.scrollVw.frame.size.height = self.view.frame.size.height
    self.scrollContainerVw.frame.size.width = self.view.frame.size.width
    self.scrollContainerVw.frame.size.height = self.view.frame.size.height
0

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


All Articles