1

I've just recently updated my code to swift 4 and I was using XLPagerTabStrip and this happened:

enter image description here

I referred to this article when I was implementing this and it was working great till Swift 3.2. It's a collection view and I'm using autoresizing for the UI not auto layouts. My code is the same as given in the article so that is why I'm not sharing any.

It has something to do with the layouts but I've tried manual and via code too.

Chaudhry Talha
  • 7,231
  • 11
  • 67
  • 116
  • Same for me. Ended up creating my own strip view. – Tamás Sengel Oct 02 '17 at 14:05
  • This is way outside the scope of this question. Start experiencing with `UIPageViewController`'s methods and scrolling delegates (I ended up using Pageboy, a drop-in `UIPageViewController` replacement though). – Tamás Sengel Oct 02 '17 at 14:08
  • 1
    FOR PEOPLE WHO ARE LOOKING FOR AN ALTERNATE! Here is a good similar library which I found: https://github.com/ermalkaleci/CarbonKit – Chaudhry Talha Oct 05 '17 at 08:58

1 Answers1

1

You can simply solve this problem by providing size for each cell.

In your parent view controller, put this code:

func collectionView(_ collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, sizeForItemAt indexPath: IndexPath) -> CGSize {

    return CGSize(width: 120 height: 40)
}

Make sure you set the buttonBarView delegate to self

buttonBarView.delegate = self

Let me know if this helped you.

Joseph Francis
  • 1,111
  • 1
  • 15
  • 26