Whenever tab bar is selected, there's this laggy transition. But when container is swiped horizontally it works smoothly.
Here's my setting
`
settings.style.buttonBarItemBackgroundColor = .white
settings.style.buttonBarBackgroundColor = .white
settings.style.buttonBarItemFont = UIFont(name: AppConstants.fonts.interUIBold, size: 12.0)!
settings.style.buttonBarItemTitleColor = AppConstants.SminqColors.purpleyGrey
settings.style.buttonBarItemsShouldFillAvailiableWidth = false
`

Any update on this?
this problem related to this function buttonBarView.moveTo inside viewDidLayoutSubviews function - class BaseButtonBarPagerTabStripViewController
i just make it works only once at app start then stopped it
here is my code
var firstRun = true
open override func viewDidLayoutSubviews() {
super.viewDidLayoutSubviews()
guard isViewAppearing || isViewRotating else { return }
// Force the UICollectionViewFlowLayout to get laid out again with the new size if
// a) The view is appearing. This ensures that
// collectionView:layout:sizeForItemAtIndexPath: is called for a second time
// when the view is shown and when the view *frame(s)* are actually set
// (we need the view frame's to have been set to work out the size's and on the
// first call to collectionView:layout:sizeForItemAtIndexPath: the view frame(s)
// aren't set correctly)
// b) The view is rotating. This ensures that
// collectionView:layout:sizeForItemAtIndexPath: is called again and can use the views
// *new* frame so that the buttonBarView cell's actually get resized correctly
cachedCellWidths = calculateWidths()
buttonBarView.collectionViewLayout.invalidateLayout()
// When the view first appears or is rotated we also need to ensure that the barButtonView's
// selectedBar is resized and its contentOffset/scroll is set correctly (the selected
// tab/cell may end up either skewed or off screen after a rotation otherwise)
if firstRun{
buttonBarView.moveTo(index: currentIndex, animated: false, swipeDirection: .none, pagerScroll: .scrollOnlyIfOutOfScreen)
firstRun = false
}
}
I have the same problem - is there an update?
I had the same problem, and I realized the reason was that I hadn't called super.viewDidAppear(true) In my override func viewDidAppear. The reason the viewDidLayoutSubviews method was called was that isViewAppearing was always true.
I hope this helps someone!
Any Update of this?
Even I am facing the same problem. This happens on the screen where I have tableview inside XLPagerTabStrip and also when I change the language which supports LTR to RTL and vice versa multiple times . Although swiping works smoothly but tapping on the tabs, animation dies slowly.
Most helpful comment
I had the same problem, and I realized the reason was that I hadn't called
super.viewDidAppear(true)In myoverride func viewDidAppear. The reason theviewDidLayoutSubviewsmethod was called was thatisViewAppearingwas always true.I hope this helps someone!