Why is UIScrollView leaving space on top and does not scroll to the bottom

后端 未结 13 2753
眼角桃花
眼角桃花 2020-12-01 09:15

I am new to objective-C programming.

I am using UIScrollView with some labels, image and text view on it.

I have turned off Autolayout and already tried wit

13条回答
  •  悲&欢浪女
    2020-12-01 09:43

    Actually, the margin has nothing to do with ScrollViewInsets or contentOffset. It's just a conflict between SuperView.Top and SafeArea.Top pinning, happens when you pin the UIScrollView to top, bottom, left and right.

    This is the right way to cover the top margin.

    1) Pin all the four sides.

    2) Select the top constraint > Change Second Item to Superview.Top

    3) Then the last step is to change the Constant to 0 (Zero).

    You might want to check this too: https://github.com/29satnam/MoveTextFieldWhenKeyboardAppearsSwift

提交回复
热议问题