如何在加载时在 tableViewCell 中显示 activity 指示器?

How to show an activity Indicator inside a tableViewCell while its loading?

我目前有一个 tableView,其中一个单元格包含一个 webView。当加载 webView 时,我希望它显示一个 activity 指示符,但只在该单元格中显示。目前指示器显示但不动画,当视频出现时它不会隐藏并停留在视频顶部。这是 tableViewCell 的代码:

class VideoOnDetailCell: UITableViewCell {
      @IBOutlet weak var videoDetail: UIWebView!
      @IBOutlet weak var activityIndicator: UIActivityIndicatorView!

  func webViewDidStartLoad(webView: UIWebView) {
    activityIndicator.hidden = false
    activityIndicator.startAnimating()
    NSLog("The web view is starting to load")
  }
  func webViewDidFinishLoad(webView: UIWebView){
    activityIndicator.hidden = true
    activityIndicator.stopAnimating()
    NSLog ("The web view has finished loading")

  }
}

这里是 cellForRowAtIndexPath:

  let cell = tableView.dequeueReusableCellWithIdentifier("videoDetail", forIndexPath: indexPath) as!
      VideoOnDetailCell

      cell.videoDetail.allowsInlineMediaPlayback = true
      cell.videoDetail.loadHTMLString("<iframe width=\"\(cell.videoDetail.frame.width)\" height=\"\(200)\" src=\"\(videoURL[indexPath.row])/?&playsinline=1\" frameborder=\"0\" allowfullscreen></iframe>", baseURL: nil)
      self.DetailTvTableView.rowHeight = 200
      return cell

问题是该单元格不是网络视图的委托,因此永远不会调用单元格中的网络视图委托方法。