无故事王国
2023-10-24 7d03245e828bbf89a7a875f8353c5ec3f26216dc
BrokerDriver/Home/VC/HomeDetailNoteVC.swift
@@ -105,15 +105,18 @@
    }
    func scrollViewDidScroll(_ scrollView: UIScrollView) {
        let totalHeight = adapterViewController.headHeight
        let offset =  totalHeight - scrollView.contentOffset.y
        let isTop = (offset - topSafeHeight) < 0
        if scrollView.contentOffset.y > 0 && !isTop{
            adapterViewController.scrollview.contentOffset = scrollView.contentOffset
        }
      let totalHeight = adapterViewController?.headHeight ?? 0
      let offset =  totalHeight - scrollView.contentOffset.y
      let isTop = (offset - topSafeHeight) < 0
      if scrollView.contentOffset.y >= 0 {
         if isTop{
            adapterViewController?.scrollview.contentOffset = CGPoint(x: 0, y: totalHeight - topSafeHeight)
         }else if scrollView.contentOffset.y <= 0{
            adapterViewController?.scrollview.setContentOffset(.zero, animated: true)
         }else{
            adapterViewController?.scrollview.contentOffset = scrollView.contentOffset
         }
      }
    }
    @IBAction func addNoteAction(_ sender: UIButton) {
@@ -128,7 +131,7 @@
                    self?.refreshStatus.onNext(.beingHeaderRefresh)
                    alert(msg: "Add note successed")
                }else{
                    alert(msg: data.msg)
                    alert(msg: data.message)
                }
            }) { error in
                alert(msg: error.localizedDescription)