Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/swift/17.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Ios uiscrollview内的swift uiwebview contentSize已展开但未滚动_Ios_Swift_Uiscrollview_Uiwebview - Fatal编程技术网

Ios uiscrollview内的swift uiwebview contentSize已展开但未滚动

Ios uiscrollview内的swift uiwebview contentSize已展开但未滚动,ios,swift,uiscrollview,uiwebview,Ios,Swift,Uiscrollview,Uiwebview,我有以下结构和约束: UIWebView和UIScrollView的contentSize设置正确,但UIScrollView工作不正常 将HTML加载到UIWebView后,我正在设置NSLayoutConstraint 这里缺的是什么?我有 如果需要整个项目,请检查代码的一部分 override func viewDidLoad() { super.viewDidLoad() self.pageWebView.scrollView.scrollEnabled = fals

我有以下结构和约束:

UIWebView
UIScrollView
contentSize
设置正确,但
UIScrollView
工作不正常

将HTML加载到
UIWebView
后,我正在设置
NSLayoutConstraint

这里缺的是什么?我有

如果需要整个项目,请检查代码的一部分

override func viewDidLoad() {
    super.viewDidLoad()

    self.pageWebView.scrollView.scrollEnabled = false
    self.pageWebView.scrollView.bounces = true
    self.pageWebView.scrollView.showsHorizontalScrollIndicator = false
    self.pageWebView.scrollView.showsVerticalScrollIndicator = true

    if let cBody = self.HTMLContent {
      self.pageWebView.loadHTMLString(cBody, baseURL: nil)
    }
    self.pageScrollView.layoutIfNeeded()
} 

internal func webViewDidFinishLoad(webView: UIWebView) {
    self.pageWebViewHeight.constant = webView.scrollView.contentSize.height
}