title: pager tab hide under the navigation bar in XLPagerTabStrip in ios swift. (using XLPagerTabStrip)
body: <p>I'm using <strong>XLPagerTabStrip</strong> in a swift 4 application, I use <strong>collectionview</strong> and everything works fine but button bar is hidden behind the navigation bar.</p>
  
  <p>i searched about this issue.so i got this link and answer </p>
  
  <p><a href="https://stackoverflow.com/questions/40020666/xlpagertabstrip-buttonbar-sticks-behind-navigation-bar">XLPagerTabStrip ButtonBar sticks behind Navigation Bar</a></p>
  
  <p>and i edit this. i set collectionview class to "ButtonBarView". link of image is this </p>
  
  <p>image link : <a href="https://i.stack.imgur.com/WjARH.png" rel="nofollow noreferrer">https://i.stack.imgur.com/WjARH.png</a></p>
  
  <p>Then connect its outlet with view in left panel</p>
  
  <p>image link : <a href="https://i.stack.imgur.com/uyFBr.png" rel="nofollow noreferrer">https://i.stack.imgur.com/uyFBr.png</a></p>
  
  <p>but it did not work for me. i searched another website and issue. </p>
  
  <p>link : <a href="https://github.com/xmartlabs/XLPagerTabStrip/issues/262" rel="nofollow noreferrer">https://github.com/xmartlabs/XLPagerTabStrip/issues/262</a></p>
  
  <p>and i edit my code with this. after </p>
  
  <pre><code> ViewDidLoad
  </code></pre>
  
  <p>add below code </p>
  
  <pre><code>self.view.layoutIfNeeded()
  buttonBarView.selectedBar.frame.origin.y = buttonBarView.frame.size.height - settings.style.selectedBarHeight
  </code></pre>
  
  <p>but it did not work. my code is </p>
  
  <pre><code>class medicationViewController: ButtonBarPagerTabStripViewController {
  
  override func viewDidLoad() {
  self.loaDesign()
  super.viewDidLoad()
  self.view.layoutIfNeeded()
  buttonBarView.selectedBar.frame.origin.y = buttonBarView.frame.size.height - settings.style.selectedBarHeight
      }
  
  override func viewControllers(for pagerTabStripController: PagerTabStripViewController) -&gt; [UIViewController] {
  
      let child_1 = UIStoryboard(name: "Main", bundle: nil).instantiateViewController(withIdentifier: "apercuViewController")
      let child_2 = UIStoryboard(name: "Main", bundle: nil).instantiateViewController(withIdentifier: "nouveauViewController")
      let child_3 = UIStoryboard(name: "Main", bundle: nil).instantiateViewController(withIdentifier: "prescripViewController")
      let child_4 = UIStoryboard(name: "Main", bundle: nil).instantiateViewController(withIdentifier: "schemaViewController")
  
      return [child_1,child_2,child_3,child_4]
  
  }
  
   func loaDesign() {
      // change selected bar color
  
      self.settings.style.selectedBarHeight = 2.0
      self.settings.style.selectedBarBackgroundColor =  UIColor(red: 0/255, green: 162/255, blue: 255/255, alpha: 1.0)
      self.settings.style.buttonBarBackgroundColor = UIColor.white
      self.settings.style.buttonBarItemBackgroundColor = UIColor.white
      self.settings.style.buttonBarItemFont = UIFont(name: "Poppins", size: 14)!
      self.settings.style.buttonBarItemTitleColor = .white
  
      self.settings.style.buttonBarMinimumLineSpacing = 0
      self.settings.style.buttonBarItemsShouldFillAvailiableWidth = true
      self.settings.style.buttonBarLeftContentInset = 0
      self.settings.style.buttonBarRightContentInset = 0
  
      changeCurrentIndexProgressive = { (oldCell: ButtonBarViewCell?, newCell: ButtonBarViewCell?, progressPercentage: CGFloat, changeCurrentIndex: Bool, animated: Bool) -&gt; Void in
  
          guard changeCurrentIndex == true else { return }
          oldCell?.label.textColor = UIColor.black
          newCell?.label.textColor =  UIColor(red: 0/255, green: 162/255, blue: 255/255, alpha: 1.0)
      }
  }
  </code></pre>
  
  <p>and in child view controller my code is </p>
  
  <pre><code> extension apercuViewController : IndicatorInfoProvider{
  
  func indicatorInfo(for pagerTabStripController: PagerTabStripViewController) -&gt; IndicatorInfo {
      return IndicatorInfo(title: "APERCU")
     }
   }
  </code></pre>
  
  <p>i want to add images of all this but they cannot allow me.
  here taking container view is necessary under collection view? i didnot take container view.</p>