Make 3 views visible with a NIPagingScrollView?

372 views Asked by At

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

1

There are 1 answers

0
Tony Arnold On BEST ANSWER

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.