1

I am playing around with NIPagingScrollView and I am wondering a couple of things:

  • Is it mandatory to return a view that has a width of 320px in pagingScrollView:pageViewForIndex:? If not, is there a way to automatically center the view in a page?
  • I would like to display on the right edge and the left edge of the screen a piece of the right and left views of the NIPagingScrollView. Is it possible?

Thanks!
Martin

MartinMoizard
  • 6,600
  • 12
  • 45
  • 75

1 Answers1

2

Basically, this works the same way as you'd do for a UIScrollView:

  1. Set clipsToBounds to NO on both the NIPagingScrollView, as well as it's child UIScrollView instance (pagingScrollView);
  2. Make your NIPagingScrollView less than the width of the parent view — 260px worked find for my needs, but adjust this as necessary;

Honestly though, if you're targeting iOS 6 or higher I would suggest using a UICollectionView instead of NIPagingScrollView. You'll get a lot more flexibility in your layout.

Tony Arnold
  • 2,738
  • 1
  • 23
  • 34