ViewPager-Swift icon indicating copy to clipboard operation
ViewPager-Swift copied to clipboard

Width can't equal with frame

Open JakfarShodiq opened this issue 5 years ago • 1 comments

Hi Guys,

I have a problem with width frame size on iPhone 5S/SE. The last tab index is offset out of the screen.

this is my current code.

tabPagerView.backgroundColor = .mainBlack options = ViewPagerOptions(viewPagerWithFrame: CGRect(x: 0, y: 0, width: view.bounds.width, height: 480)) options.tabType = ViewPagerTabType.basic options.fitAllTabsInView = true options.tabViewBackgroundDefaultColor = .mainBlack))

Any idea?

Thanks, Jakfar

JakfarShodiq avatar Apr 24 '19 14:04 JakfarShodiq

Hi @JakfarShodiq ,

The library has been updated. If you are supporting swift 4.2 or higher, please update the pod and look into new implementation which now doesn't depend upon the frame size.

Make sure that you are providing the correct frame size. Set the frame correctly in viewDidLayoutSubviews() method.

override func viewDidLayoutSubviews() {
    super.viewDidLayoutSubviews()

    options. viewPagerFrame = <Your Correct Frame>
}

nrlnishan avatar Apr 25 '19 13:04 nrlnishan