                     self.topImageView.kf.setImage(with: URL(string: urlString))
                 }
                 self.titleLabel.text = model.title
+                if let title = model.title {
+                    let size = CGSize(width: screenW - 30, height: CGFloat(MAXFLOAT))
+                    let textH = (title as NSString).boundingRect(with: size, options: .usesLineFragmentOrigin, attributes: [NSFontAttributeName: self.titleLabel.font], context: nil).height
+                    if textH > 25 {
+                        self.titleLabel.frame.origin.y = 120
+                        self.titleLabel.frame.size.height = 55
+                    }else {
+                        self.titleLabel.frame.origin.y = 150
+                        self.titleLabel.frame.size.height = 26
+                    }
+                }
                 if let source = model.image_source {
                     self.imgLabel.text = "图片:\(source)"
                 }

        super.init(frame: CGRect.zero, configuration: config)
        setupUI()
        
        // 监听偏移量
        offset.asDriver()
            .filter { $0.y < 0 }

    fileprivate var maskImageView: UIImageView!
    fileprivate var titleLabel: UILabel!
    fileprivate var imgLabel: UILabel!
    fileprivate var preLabel: UILabel!
    fileprivate var nextLabel: UILabel!
    fileprivate var indicatorView: UIActivityIndicatorView!
}

extension MPWebView: WKNavigationDelegate {
    
    func webView(_ webView: WKWebView, decidePolicyFor navigationAction: WKNavigationAction, decisionHandler: @escaping (WKNavigationActionPolicy) -> Void) {
        indicatorView.startAnimating()
        decisionHandler(.allow)
    }
    
    func webView(_ webView: WKWebView, didFinish navigation: WKNavigation!) {
        indicatorView.stopAnimating()
        webView.evaluateJavaScript("document.body.scrollHeight") { (result, error) in
            if let height = result as? CGFloat {
                self.nextLabel.frame.origin.y = height + 50
            }
        }
    }
    
    func webView(_ webView: WKWebView, didFail navigation: WKNavigation!, withError error: Error) {
        indicatorView.stopAnimating()
    }
}


