0
XLpagerTabStrip cocoapods拡張機能を使用して、ビューコントローラ(https://github.com/xmartlabs/XLPagerTabStrip)の上部にタブバーを設定しています。 ButtonBarPagerTabStripViewControllerを実装していて、手順を正確に実行しましたが、UIScrollViewが子ビューコントローラを表示していません。タブ付きビューコントローラ内Swift:UIScrollViewはXLPagerTabStripを使用して子ビューコントローラを表示しません。
コード:子ビュー・コントローラー内
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")
}
Image showing the connections of the ButtonBarView and UIScrollView