Ios 在我的应用程序中实现时出现XLPagerTabStrip问题
我正在使用我的应用程序中的Ios 在我的应用程序中实现时出现XLPagerTabStrip问题,ios,swift,uicollectionview,uiscrollview,xlpagertabstrip,Ios,Swift,Uicollectionview,Uiscrollview,Xlpagertabstrip,我正在使用我的应用程序中的Swift创建,我正在实现XLPagerTabStrip,我已经参考了下面的博客,这里是链接 虽然当我导航到我的主屏幕,然后在状态栏上显示我得到的输出类型,但一切都很完美 这是我的控制器代码 import UIKit import XLPagerTabStrip class HomeViewController: ButtonBarPagerTabStripViewController { //MARK: - VARIABLEs /
Swift
创建,我正在实现XLPagerTabStrip
,我已经参考了下面的博客,这里是链接
虽然当我导航到我的主屏幕,然后在状态栏上显示我得到的输出类型,但一切都很完美
这是我的控制器代码
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]
}
}
我所做的一切都和演示应用程序中提供的一样,但仍然XLPagerTabStrip
覆盖了状态栏和视图,其中包含通知和菜单图标。我无法理解为什么会发生这种情况。我所做的一切都和演示中的一样。有人知道这一点吗
正如你在故事板屏幕截图中看到的,我添加了菜单和通知图标,但运行应用程序时,XLPagerTabStrip
覆盖了整个视图
有谁知道为什么会发生这样的事吗?那么请建议我请阅读官方团队的博客。
谢谢,伙计,这救了我一天!