     public var tabMargin: CGFloat = 9
     /** 页面跳转是否开启动画，默认开启 */
     public var isAnimated: Bool = true
-    /** 
+    /**
      *  更新当前页面数据，回传当前界面的索引值。
      *  注意：必须在buildUI 方法调用之前实现
      */

        if refreshDataBlock != nil {
            refreshDataBlock!(defaultSelectedIndex)
        }
    
    }
    
    /** 给顶部标签栏添加一条分割线 */
    func createTopScrollViewSplite(){
        let frame = CGRect(x: 0, y: topScrollViewHeight-0.3, width: self.frame.size.width, height: 0.3)
        let layer = CALayer()
        layer.backgroundColor = UIColor(red: 121/255, green: 121/255, blue: 121/255, alpha: 1).cgColor
        layer.frame = frame
        topScrollView.layer.addSublayer(layer)
    }
    
    /** 创建页标签按钮 */

            // 滚动条
            underLineLayer.frame.origin.x = (scrollView.contentOffset.x/width)*underLineOffsetX+tabMargin
            if !isAutomatic {
                // 当根视图滑过当前界面上所显示页标签按钮一半时，滚动页标签
                // rootScrollView 滑动了几个屏幕宽度
                let count = Int(rootScrollView.contentOffset.x/width)
                if count < minCount{
                    topScrollViewOffSetX = 0
                }else if count >= minCount && count <= (maxCount+minCount) {
                    if (count - minCount) == maxCount{
                        topScrollViewOffSetX = topMaxOffsetX
                    }else{
                        topScrollViewOffSetX = (tabItemSpace+tabItemWidth)*(CGFloat(count-minCount+1))+tabMargin
                    }
                }else{
                    topScrollViewOffSetX = topMaxOffsetX
                }
                if !scrollView.isTracking{
                    if topScrollViewOffSetX >= topMaxOffsetX{
                        topScrollViewOffSetX = topMaxOffsetX
                    }
                    topScrollView.setContentOffset(CGPoint(x: topScrollViewOffSetX, y: 0), animated: true)
                }
            }
        }
    }
    
    //    public func scrollViewDidEndDragging(_ scrollView: UIScrollView, willDecelerate decelerate: Bool){
    //        if scrollView == rootScrollView{
    //            print("topScrollViewOffSetX: \(topScrollViewOffSetX)")
    //            if topScrollViewOffSetX >= topMaxOffsetX{
    //                topScrollViewOffSetX = topMaxOffsetX
    //            }
    //            topScrollView.setContentOffset(CGPoint(x: topScrollViewOffSetX, y: 0), animated: true)
    //        }
    //    }
    
    public func scrollViewDidEndDecelerating(_ scrollView: UIScrollView){
        let width = self.frame.size.width
