Bounds automatically changes on UIScrollView with content insets

后端 未结 5 674
傲寒
傲寒 2020-12-28 22:54

I\'m using a UIScrollView as my paging scroll view, pagesScrollView. Inside that, I put individual UIScrollViews which are used exclusively for zooming. Inside

5条回答
  •  抹茶落季
    2020-12-28 23:59

    My pagesScrollView has contentInset.top = 64 and bounds.origin.y = -64 (that seems weird to me, but that's what the system is setting automatically for me), and this works just fine. My screen looks great!

    It because of iOS 7 sets contentInset.top to 64 on all scrollviews. Just add this line of code into your view controller and all will work as expected:

    -(UIRectEdge)edgesForExtendedLayout {
    return UIRectEdgeNone;
    

    }

    I checked on your example project.

提交回复
热议问题