1

There is a bug with my UIScrollView populated with xib files that does not accurately resize xibs to fit the view. As such, when scrolling there is a noticeable offset emanating from the right side of each presented xib element and the contexts of the next element bleed into the previous. It formats correctly on the iPhone 6, but no screen larger than it.

Given that there are no constants in my code and the dimensions should be retrieved from the view itself regardless of size (using view.frame.width and view.frame.height), I wonder if there's some larger point I'm missing about UIScrollView or wether or not it simply isn't the best solution to my problem. Is there another class for creating a sort of scrollable horizontal slide-show?

Amal T S
  • 3,327
  • 2
  • 24
  • 57
metalek
  • 165
  • 1
  • 1
  • 6
  • @metalet I think you have to set content offset of UIScrollView. Please try to set it – Ashok Londhe Jul 04 '17 at 06:09
  • How you determined that it is a bug? are you using autolayout? although what are you trying to achieve is unclear for me, I would suggest to check [this answer](https://stackoverflow.com/questions/39714212/make-view-controller-scrollable-with-collection-view/39714489#39714489). – Ahmad F Jul 04 '17 at 06:12

1 Answers1

1

You need to add constraints in order to make it work correctly in different screen sizes.

enter image description here

Lawliet
  • 3,438
  • 2
  • 17
  • 28
  • Wow. I didn't expect it to be that simple, I had followed another guide that had specified other autolayout constraints. That worked. Thanks for your help. – metalek Jul 04 '17 at 20:09