我一直在关注 XLpagerTabStrip cocoapods 扩展,在我的视图控制器顶部设置一个标签栏(https://github.com/xmartlabs/XLPagerTabStrip)。我正在实现 ButtonBarPagerTabStripViewController 并完全按照步骤操作,但 UIScrollView 没有显示子视图控制器。
选项卡式视图控制器中的代码:
import UIKit
import XLPagerTabStrip
class MenuTabStrip: ButtonBarPagerTabStripViewController {
override func viewDidLoad() {
self.settings.style.selectedBarHeight = 5.0
self.settings.style.selectedBarBackgroundColor = UIColor.blueColor()
super.viewDidLoad()
// Do any additional setup after loading the view.
}
override func didReceiveMemoryWarning() {
super.didReceiveMemoryWarning()
// Dispose of any resources that can be recreated.
}
override func viewControllersForPagerTabStrip(pagerTabStripController: PagerTabStripViewController) -> [UIViewController]{
return [Reminders(), testbobViewController()]
}
子视图控制器中的示例代码:
import UIKit
import XLPagerTabStrip
class testbobViewController: UIViewController, IndicatorInfoProvider {
override func viewDidLoad() {
super.viewDidLoad()
// Do any additional setup after loading the view.
}
override func didReceiveMemoryWarning() {
super.didReceiveMemoryWarning()
// Dispose of any resources that can be recreated.
}
func indicatorInfoForPagerTabStrip(pagerTabStripController: PagerTabStripViewController) -> IndicatorInfo {
return IndicatorInfo(title: "test bob")
}