I've seen the setContentOffset:animated: method. Is that going to scroll to a specific position, or what does that "offset" mean?
Step 1: Put a scroll view into the view controller and set constraints. Step 2 : Put a view inside the scroll view and set constraints. Step 3: Placing UI Elements inside Content view.
You cannot make a UIView scrollable. That's what UIScrollView is for. However if you are using storyboards you can try to add constraints to the view so when you rotate the device the content remains inside the viewable area.
1: go to you view controller and click on Attribute Inspector . 2: change Size to Freeform instead of Inferred. 3: Go to the main view on that storyboard, not your scrollview but rather the top level view. 4: Click Size Inspector and set this view to your desired size.
Yes. From the Apple documentation:
setContentOffset:animated:
Sets the offset from the content view’s origin that corresponds to the receiver’s origin.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With