You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I added this as a horizontal scroll view to an app that only uses landscape orientation. I can't stop it from allowing vertical scrolling. It also does not page the the correct x coordinate. Only the first subview is in the correct position. I'm developing on iOS 9.3. Any help would be appreciated.
The text was updated successfully, but these errors were encountered:
You must have a problem either with the constraints of the scrollview or with the contentSize property.
When I created this lib, I didn't use Autolayout, so you have to set the contentSize manually and position the elements inside manually also. Something like:
var x : CGFloat = 0.0
pageControl.currentPage = 0
pageControl.numberOfPages = scrollView.subviews.count
for view in scrollView.subviews {
view.frame = CGRect(x: x, y: 0, width: CGRectGetWidth(scrollView.frame), height: CGRectGetHeight(scrollView.frame))
x = CGRectGetMaxX(placeView.frame)
}
scrollView.contentSize = CGSize(width: x, height: CGRectGetHeight(scrollView.frame))
scrollView.setContentOffset(CGPoint(), animated: false)
I added this as a horizontal scroll view to an app that only uses landscape orientation. I can't stop it from allowing vertical scrolling. It also does not page the the correct x coordinate. Only the first subview is in the correct position. I'm developing on iOS 9.3. Any help would be appreciated.
The text was updated successfully, but these errors were encountered: