         addSubview(topScrollView)
         
         //  创建主滑动视图
-        rootScrollView = UIScrollView(frame: CGRect(x: 0, y: kHeightOfTopScrollView,
-            width: self.bounds.width, height: self.bounds.height - kHeightOfTopScrollView))
+        rootScrollView = UIScrollView(frame: CGRect(x: 0, y: kHeightOfTopScrollView, width: self.bounds.width, height: self.bounds.height - kHeightOfTopScrollView))
         rootScrollView.delegate = self
         rootScrollView.isPagingEnabled = true
         rootScrollView.isUserInteractionEnabled = true

            topScrollView.setContentOffset(CGPoint(x: sender.frame.origin.x - kWidthOfButtonMargin, y: 0), animated: true)
        }
    }
    
    //  MARK: Main view logic method
    @objc fileprivate func scrollHandlePan(_ panParam: UIPanGestureRecognizer) {
        if rootScrollView.contentOffset.x <= 0 {
            if delegate != nil && (delegate as! UIViewController).responds(to: #selector(RGSwitchViewDelegate.switchView(_:panLeftEdge:))) {

            
            UIView.animate(withDuration: 0.25, animations: { () -> Void in
                self.shadowImageView.frame = CGRect(x: sender.frame.origin.x, y: 0,
                                                    width: sender.frame.size.width, height: self.shadowImage.size.height)
            }, completion: { (finished) -> Void in
                if finished == true {
                    //  设置新页面出现
                    if self.isRootScroll == false {
                        self.rootScrollView.setContentOffset(CGPoint(x: CGFloat(sender.tag - 100) * self.bounds.width, y: 0), animated: true)
                    }
                    self.isRootScroll = false

                    if let delegate = self.delegate {
                        if (delegate as! UIViewController).responds(to: #selector(RGSwitchViewDelegate.switchView(_:didSelectTab:))) {}
                        delegate.switchView?(self, didSelectTab: self.userSelectedChannelID - 100)
                    } else {
                        print("delegate in RGSwitchView is nil", terminator: "")
                    }

                }
            })
        } else {    //  重复点击选中按钮
            
