iosswiftuicollectionviewuiscrollviewxlpagertabstrip

issue with XLPagerTabStrip while implementing in my app


i am creating using Swift in my app i am implementing XLPagerTabStrip and i have referred below blog to implement here is the link

This is the reference link

all thing works perfect although when i navigate to my Home screen then XLPagerTabStrip showing over status bar here is the screenshot what type of output i am getting

This is the screen shot of output which i am getting

This is expected output i want something like this

This is storyboard screenshot

here is my Controller code

import UIKit
import XLPagerTabStrip

class HomeViewController: ButtonBarPagerTabStripViewController {

    //MARK: - VARIABLEs
    
    //MARK: - OUTLETs
    
    //MARK: - VOID METHODs
    
    override func viewDidLoad() {
        configureButtonBar()
        super.viewDidLoad()
        // Do any additional setup after loading the view.
    }
    
    //MARK: - CLICKED EVENTs
    
    //MARK: - FUNCTIONs
    func configureButtonBar() {
        settings.style.buttonBarBackgroundColor = .white
        settings.style.buttonBarItemBackgroundColor = .white

        settings.style.buttonBarItemFont = UIFont(name: "Roboto-Medium", size: 14.0)!
        settings.style.buttonBarItemTitleColor = UIColor(red: 84/255, green: 84/255, blue: 84/255, alpha: 1)
        
        settings.style.buttonBarMinimumLineSpacing = 0
        settings.style.buttonBarItemsShouldFillAvailableWidth = true
        settings.style.buttonBarLeftContentInset = 0
        settings.style.buttonBarRightContentInset = 0

        settings.style.selectedBarHeight = 3.0
        settings.style.selectedBarBackgroundColor = UIColor(red: 112/255, green: 112/255, blue: 112/255, alpha: 1)
        
        // Changing item text color on swipe
        changeCurrentIndexProgressive = { [weak self] (oldCell: ButtonBarViewCell?, newCell: ButtonBarViewCell?, progressPercentage: CGFloat, changeCurrentIndex: Bool, animated: Bool) -> Void in
            guard changeCurrentIndex == true else { return }
            oldCell?.label.textColor = UIColor(red: 84/255, green: 84/255, blue: 84/255, alpha: 1)
            newCell?.label.textColor = UIColor(red: 112/255, green: 112/255, blue: 112/255, alpha: 1)
        }
    }
    
    override func viewControllers(for pagerTabStripController: PagerTabStripViewController) -> [UIViewController] {
        let child1 = UIStoryboard.init(name: "Functional", bundle: nil).instantiateViewController(withIdentifier: "FeedViewController") as! FeedViewController
        
        let child2 = UIStoryboard.init(name: "Functional", bundle: nil).instantiateViewController(withIdentifier: "ArticlesViewController") as! ArticlesViewController
        
        return [child1, child2]
    }
}

i did everything same as provided in demo app but still XLPagerTabStrip covers status bar and view which contain notification and menu icon i can't get it why this is happing i did everything as in demo can anyone have idea about this

as you can see in storyboard screenshot i have added menu and notification icon but XLPagerTabStrip covers that whole view when run the app

can anyone have idea why this is happing then please suggest me


Solution

  • Please read the blog from the official team. XLPagerTabStrip tutorial