Swift:UIScrollView不使用XLPagerTabStrip显示子视图控制器

时间:2016-06-12 13:22:20

标签: ios swift uiscrollview xlpagertabstrip

我一直在关注XLpagerTabStrip cocoapods扩展程序,在我的视图控制器(http://neo4j.com/docs/2.3.4/configuration-settings.html#config_dbms.querylog.enabled)顶部设置一个标签栏。 我正在实现ButtonBarPagerTabStripViewController并完全按照步骤操作,但UIScrollView没有显示子视图控制器。

选项卡式视图控制器中的

代码:

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")
}

子视图控制器中的示例代码:

public static int ggT(int a, int b) {
        int result = 0;
        if (a == b){
            result = a;
        } else if ( a > b){
            a -= b;
        } else if (b > a){
            b -= a;
        }

        if(a > b) {    //Check 
            result = b % a; 
        } else if(b > a){
            result = a % b;
        } else if(b == a){
            result = a;
        }
        return result;
    }

https://github.com/xmartlabs/XLPagerTabStrip

1 个答案:

答案 0 :(得分:0)

您应该使用storyboard!.instantiateViewControllerWithIdentifier 在

    override func viewControllersForPagerTabStrip(pagerTabStripController: PagerTabStripViewController) -> [UIViewController]{

}

如果您使用storyboard和IB

,而不是直接初始化ViewController