Commit 6f7361da authored by Steven杜宇's avatar Steven杜宇

// plan

parent 3c409ac1
...@@ -370,7 +370,7 @@ class YHPlanTestViewController: YHBaseViewController { ...@@ -370,7 +370,7 @@ class YHPlanTestViewController: YHBaseViewController {
self.tableView.reloadData() self.tableView.reloadData()
UIView.performWithoutAnimation { UIView.performWithoutAnimation {
self.tableView.scrollToRow(at: IndexPath(row: 0, section: self.infoArr.count-2), at: .bottom, animated: false) self.tableView.scrollToRow(at: IndexPath(row: NSNotFound, section: self.infoArr.count-2), at: .top, animated: false)
self.tableView.setContentOffset(.zero, animated: false) self.tableView.setContentOffset(.zero, animated: false)
} }
} }
...@@ -542,7 +542,7 @@ extension YHPlanTestViewController: UIScrollViewDelegate { ...@@ -542,7 +542,7 @@ extension YHPlanTestViewController: UIScrollViewDelegate {
for index in 0...infoArr.count-1 { for index in 0...infoArr.count-1 {
let rect = self.tableView.rectForRow(at: IndexPath(row: 0, section: index)) let rect = self.tableView.rectForRow(at: IndexPath(row: 0, section: index))
let conditon = tableView.contentOffset.y <= rect.origin.y let conditon = tableView.contentOffset.y <= rect.origin.y-44.0
if conditon, index < infoArr.count-1 { if conditon, index < infoArr.count-1 {
find = true find = true
...@@ -572,10 +572,10 @@ extension YHPlanTestViewController: JXSegmentedViewDelegate { ...@@ -572,10 +572,10 @@ extension YHPlanTestViewController: JXSegmentedViewDelegate {
func segmentedView(_ segmentedView: JXSegmentedView, didSelectedItemAt index: Int) { func segmentedView(_ segmentedView: JXSegmentedView, didSelectedItemAt index: Int) {
let index = segmentedView.selectedIndex let index = segmentedView.selectedIndex
let rect = self.tableView.rectForHeader(inSection: index) let rect = self.tableView.rectForHeader(inSection: index)
let gap = index > 0 ? 8.0 : 0.0 let gap = index > 0 ? 8.0 : 0.0
self.tableView.setContentOffset(CGPoint(x: 0, y: rect.origin.y-44.0-gap), animated: true) self.tableView.setContentOffset(CGPoint(x: 0, y: rect.origin.y-44.0-gap), animated: true)
if segmentedView == segmented1View { if segmentedView == segmented1View {
self.segmented2View.defaultSelectedIndex = index self.segmented2View.defaultSelectedIndex = index
......
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