Open 01sunjon opened 7 years ago
Hi @01sunjon,
Are you using storyboard or creating the UI by code? If you are using storyboard then its really simple, since you could simply set the constrains for the buttonBarView
where you want, in this case, to the middle.
If you are setting the UI programatically, then you should set the frame of buttonBarView
programatically after viewDidLoad
, or programatically add constraints to it.
Hope it helps! Regards,
Hi @01sunjon ,
It doesn't work by any of the method.
@01sunjon @vansh1sh @fedeojeda95 I met the same problem. Setting the constraints in storyboard doesn't work and the PagerTab always comes at the top of screen. How can I solve it ?
@taichikoumoto Try to set constraints properly, it did work for me after then.
Also had this issue but I figured it out as well. Along with the constraints, you have to ensure that you have the delegates set correctly.
Connect outlets and add layout constraints
We strongly recommend to use IB to set up our page controller views.
Drag into the storyboard a UIViewController and set up its class with your pager controller (MyPagerTabStripName). Drag a UIScrollView into your view controller view and connect PagerTabStripViewController containerView outlet with the scroll view.
Depending on which type of paging view controller you are working with you may have to connect more outlets.
For BarPagerTabStripViewController we should connect barView outlet. barView type is UIView. ButtonBarPagerTabStripViewController requires us to connect buttonBarView outlet. buttonBarView type is ButtonBarView which extends from UICollectionView. SegmentedPagerTabStripViewController has a segmentedControl outlet, if the outlet is not connected the library try to set up the navigationItem titleView property using a UISegmentedControl. TwitterPagerTabStripViewController doesn't require us to connect any additional outlet.
This lets me to add the tabs at the Upper of the viewcontroller. But i want them to be at the middle of the screen. how can i achieve this..??