在我的应用程序中实施时 XLPagerTabStrip 出现问题
issue with XLPagerTabStrip while implementing in my app
我在我的应用程序中使用 Swift
创建我正在实施 XLPagerTabStrip
我在下面提到的博客中实施这里是 link
虽然当我导航到我的主屏幕然后 XLPagerTabStrip
显示在状态栏上的屏幕截图是我得到的输出类型
,但一切都很完美
This is the screen shot of output which i am getting
This is expected output i want something like this
This is storyboard screenshot
这是我的控制器代码
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
覆盖了整个视图,而 运行 应用
谁能知道为什么会这样然后请给我建议
请阅读官方团队的博客。
XLPagerTabStrip tutorial
我在我的应用程序中使用 Swift
创建我正在实施 XLPagerTabStrip
我在下面提到的博客中实施这里是 link
虽然当我导航到我的主屏幕然后 XLPagerTabStrip
显示在状态栏上的屏幕截图是我得到的输出类型
This is the screen shot of output which i am getting
This is expected output i want something like this
This is storyboard screenshot
这是我的控制器代码
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
覆盖了整个视图,而 运行 应用
谁能知道为什么会这样然后请给我建议
请阅读官方团队的博客。 XLPagerTabStrip tutorial