Commit 72c04dde authored by Steven杜宇's avatar Steven杜宇

// 生活详情

parent 99fd4f3f
......@@ -231,13 +231,6 @@ class YHLifeDetailViewController: YHBaseViewController {
make.top.equalTo(self.topSegmentedView.snp.bottom)
}
}
override func viewDidLayoutSubviews() {
super.viewDidLayoutSubviews()
if self.tableView.contentSize != self.fakeTableView.contentSize {
self.tableView.contentSize = self.fakeTableView.contentSize
}
}
}
extension YHLifeDetailViewController: JXSegmentedViewDelegate {
......@@ -414,10 +407,10 @@ extension YHLifeDetailViewController {
self.headImgView.snp.updateConstraints { make in
make.height.equalTo(imgHeight)
}
self.headerView.setNeedsLayout()
self.headerView.layoutIfNeeded()
self.tableView.tableHeaderView = self.headerView
self.fakeTableView.tableHeaderView?.height = self.headerHeight
self.fakeTableView.tableHeaderView = UIView(frame: CGRect(x: 0, y: 0, width: KScreenWidth, height: self.headerHeight))
self.view.setNeedsLayout()
self.view.layoutIfNeeded()
case .failure(let error):
print("image download failed: \(error.localizedDescription)")
......@@ -446,10 +439,14 @@ extension YHLifeDetailViewController {
ossGroup.notify(queue: .main) {
self.tableView.reloadData()
self.fakeTableView.reloadData {
self.fakeTableView.setContentOffset(.zero, animated: false)
self.fakeTableView.scrollToRow(at: IndexPath(row: self.imgItems.count-1, section: 0), at: .top, animated: true)
self.view.setNeedsLayout()
self.view.layoutIfNeeded()
DispatchQueue.main.asyncAfter(deadline: .now()+0.3, execute: {
self.fakeTableView.setContentOffset(.zero, animated: false)
if self.imgItems.count > 0 {
self.fakeTableView.scrollToRow(at: IndexPath(row: self.imgItems.count-1, section: 0), at: .top, animated: true)
}
self.fakeTableView.setNeedsLayout()
self.fakeTableView.layoutIfNeeded()
})
}
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment