2016-06-12 34 views
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

答えて

0

あなたは、ストーリーボードを使用する必要があります

で .instantiateViewControllerWithIdentifier! 0代わりのViewControllerの直接の初期化の

}

あなたはストーリーボードとIB

を使用している場合
関連する問題