Is there a method of programmatically controlling a UIScrollView? As in, getting a value for its location, so how far along it is scrolled and things and change its position, scroll it programmatically?
Is there a method of programmatically controlling a UIScrollView? As in, getting a value
Share
I don’t know what either of @Alexandergre or @JAgostoni are talking about. Scrolling in UIScrollView is really easy.
I suggest you take a look at the documentation for UIScrollView:
http://developer.apple.com/library/ios/#documentation/uikit/reference/UIScrollView_Class/Reference/UIScrollView.html
To scroll a UIScrollView, simply use
Example:
That will scroll a UIScrollView with animation to a 20 on the x axis, 20 on the y and 320×480 height and width.
If you want to get information of the view it self(for example what frame is visible) you should use methods and properties from UIView, as it’s UIScrollView’s parent.
Check out the UIView documentation at: http://developer.apple.com/library/ios/#documentation/uikit/reference/UIView_Class/UIView/UIView.html
To get the frame that is visible, use
Do not mix it up with the content size
But, as i said. Use the documentation!