xmartlabs / XLPagerTabStrip

Android PagerTabStrip for iOS.
MIT License
6.97k stars 1.33k forks source link

xlpagertabstrip tabs spacing issue swift #600

Open hassan8055 opened 6 years ago

hassan8055 commented 6 years ago

I am making an tablet app in which i used xlpagertabstrip(third party library) for tabs. So i setup everything giving in documentation. But the issue is when i opened the Viewcontroller from a simple button it looks fine. This is Container view Code: ` override func viewControllers(for pagerTabStripController: PagerTabStripViewController) -> [UIViewController] { let child_1 = UIStoryboard(name: "Main", bundle: nil).instantiateViewController(withIdentifier: "DailyStaticsReportsVC") let child_2 = UIStoryboard(name: "Main", bundle: nil).instantiateViewController(withIdentifier: "DeliveryDriveReportVC") let child_3 = UIStoryboard(name: "Main", bundle: nil).instantiateViewController(withIdentifier: "ItemSaleReportVC") let child_4 = UIStoryboard(name: "Main", bundle: nil).instantiateViewController(withIdentifier: "DeliveryOrdersReportVC")

    return [child_1,child_2, child_3, child_4]
}
`

And when i Opened from a side menu .Then the spacing between the tabs is ruined. All the tabs comes to left side and shrink the tabs. and this is left menu code:

@IBAction func sideMenuTapped(_ sender: UIBarButtonItem) { panel?.configs = FAPanelConfigurations() panel?.openLeft(animated: true) }

subhankar-acharya commented 5 years ago

I am facing the same issue.

davidgdoll commented 5 years ago

I know that this is tricky, but that was happening to me, and the only way i managed to get this behavior fixed was setting:

On viewDidLoad buttonBarView.translatesAutoresizingMaskIntoConstraints = true and then on viewWillAppear buttonBarView.translatesAutoresizingMaskIntoConstraints = false

talat-baig commented 4 years ago

I know that this is tricky, but that was happening to me, and the only way i managed to get this behavior fixed was setting:

On viewDidLoad buttonBarView.translatesAutoresizingMaskIntoConstraints = true and then on viewWillAppear buttonBarView.translatesAutoresizingMaskIntoConstraints = false

Hi, I tried this but, spacing not shrinking but my rightmost menu item got spaced more towards to right and barbuttonView started scrolling. Any clue why is that happening... Please guide me through anyone