I have a problem with buttonBarView frame and strange containerView's frame changing in runtime.
Here is the gif

Or the link to the same with higher quality - https://im.ezgif.com/tmp/ezgif-1-6ae18b79c5.gif
I'm trying to configure all this from code, without using Storyboard.
So, the problem is that in case I use isTranslucent navigationBar, elements' frames are wrong... I tried to add constraints manually from code, but I cannot fix issue with containerView's frame, that changes each time I manually change the tab by clicking on the buttonBarView's item.
override func viewDidLoad() {
defaultXLTabStripColors()
super.viewDidLoad()
injectXLTabStripIntoNavBar()
configureTabStripAfterViewDidLoad()
}
func injectXLTabStripIntoNavBar(){
containerView.frame = self.view.bounds // hack to fix XLPagerTabStrip without xib
buttonBarView.removeFromSuperview()
navigationController?.navigationBar.addSubview(buttonBarView)
}
@johndpope this is not working. The line containerView.frame = self.view.bounds doesn't fix the issue. ContainerView frame still is changing to the wrong value when you manually click on the buttonBarView item.
Just for fun, I have tried to add buttonBarView, and it gives me a lot of problems :) First of all I need to remove buttonBarView once I pop to previous viewController. Also, the actual content of the navigationBar got hidden by buttonBarView which was expected actually
These solutions don't work for me. Also, they don't actually look like solutions, but more like hacks, which I believe is not a good way.
I'm not sure if you are a developer of this pod, or someone else... Are you able to fix the issue with having translucent navigationBar and containerView frame bug? Maybe there are a list of constraints that I could set to make it works as expected?
Also, I don't understand what is the idea to change containerView frame each time the tab is changed at all... Maybe there were some issues because of the fact that containerView is a scrollView. For such libraries it looks more native to use UIPageController, doesn't it?
I am simply a user of the pod, not the developer.
I had trouble with the navigation control part of the library as it wasn't built to do things programmatically, it's expecting a storyboard. Feel free to rebuild entire library so it's not a 'hack'.
This is a related architectural design bug for more background.
https://github.com/xmartlabs/XLPagerTabStrip/issues/299
When you click the other item, and you say the bounds are wrong,
try forcing it again to correct
containerView.frame = self.view.bounds
you could try this library instead
https://github.com/CosmicMind/Samples/tree/master/Projects/Programmatic/PageTabBarController
IC. I would probably find another pod instead.
And will keep this issue opened just in case some of the developers really read these issues :)
Thanks
So, PageTabBarController from CosmicMind has this bug too.
And actually, it figured out it is not a bug in the pod, it is just a negative point of not using storyboard/xib.
Fixed the issue with self.edgesForExtendedLayout = []
Most helpful comment
So, PageTabBarController from CosmicMind has this bug too.
And actually, it figured out it is not a bug in the pod, it is just a negative point of not using storyboard/xib.
Fixed the issue with
self.edgesForExtendedLayout = []