Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
G
galaxy-iOS
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
mobile-group
galaxy-iOS
Commits
1f0ecf1f
Commit
1f0ecf1f
authored
Jul 08, 2024
by
Steven杜宇
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
// 文件清单
parent
352fd929
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
43 additions
and
23 deletions
+43
-23
YHMyFileListViewController.swift
...e(服务中心)/FileList(文件清单)/C/YHMyFileListViewController.swift
+43
-22
YHSegmentView.swift
...lligentService(服务中心)/FileList(文件清单)/V/YHSegmentView.swift
+0
-1
No files found.
galaxy/galaxy/Classes/Modules/IntelligentService(服务中心)/FileList(文件清单)/C/YHMyFileListViewController.swift
View file @
1f0ecf1f
...
@@ -54,7 +54,6 @@ class YHMyFileListViewController: YHBaseViewController {
...
@@ -54,7 +54,6 @@ class YHMyFileListViewController: YHBaseViewController {
tableView
.
showsVerticalScrollIndicator
=
false
tableView
.
showsVerticalScrollIndicator
=
false
tableView
.
backgroundColor
=
UIColor
.
init
(
hex
:
0xDCE4F1
)
tableView
.
backgroundColor
=
UIColor
.
init
(
hex
:
0xDCE4F1
)
tableView
.
separatorStyle
=
.
none
tableView
.
separatorStyle
=
.
none
tableView
.
bounces
=
false
tableView
.
register
(
YHMyFileListCell
.
self
,
forCellReuseIdentifier
:
YHMyFileListCell
.
cellReuseIdentifier
)
tableView
.
register
(
YHMyFileListCell
.
self
,
forCellReuseIdentifier
:
YHMyFileListCell
.
cellReuseIdentifier
)
tableView
.
register
(
YHMyFileListNoneCell
.
self
,
forCellReuseIdentifier
:
YHMyFileListNoneCell
.
cellReuseIdentifier
)
tableView
.
register
(
YHMyFileListNoneCell
.
self
,
forCellReuseIdentifier
:
YHMyFileListNoneCell
.
cellReuseIdentifier
)
tableView
.
delegate
=
self
tableView
.
delegate
=
self
...
@@ -241,12 +240,12 @@ class YHMyFileListViewController: YHBaseViewController {
...
@@ -241,12 +240,12 @@ class YHMyFileListViewController: YHBaseViewController {
}
}
let
offsetY
=
self
.
tableView
.
contentOffset
.
y
-
k_Height_NavigationtBarAndStatuBar
-
self
.
topSegmentHeight
+
gap
let
offsetY
=
self
.
tableView
.
contentOffset
.
y
-
k_Height_NavigationtBarAndStatuBar
-
self
.
topSegmentHeight
+
gap
let
maxOffSetY
=
self
.
tableView
.
contentSize
.
height
-
self
.
tableView
.
frame
.
size
.
height
let
maxOffSetY
=
self
.
tableView
.
contentSize
.
height
-
self
.
tableView
.
frame
.
size
.
height
if
abs
(
offsetY
)
<=
maxOffSetY
{
//
if abs(offsetY) <= maxOffSetY {
// 此处+2是弥补section结合处偏差与tab显示
// 此处+2是弥补section结合处偏差与tab显示
self
.
tableView
.
setContentOffset
(
CGPointMake
(
0
,
offsetY
+
4
),
animated
:
false
)
self
.
tableView
.
setContentOffset
(
CGPointMake
(
0
,
offsetY
+
4
),
animated
:
false
)
}
else
{
//
} else {
self
.
tableView
.
setContentOffset
(
CGPointMake
(
0
,
maxOffSetY
-
1
),
animated
:
false
)
//
self.tableView.setContentOffset(CGPointMake(0, maxOffSetY-1), animated: false)
}
//
}
})
})
}
}
}
}
...
@@ -385,29 +384,51 @@ extension YHMyFileListViewController : UITableViewDelegate, UITableViewDataSourc
...
@@ -385,29 +384,51 @@ extension YHMyFileListViewController : UITableViewDelegate, UITableViewDataSourc
self
.
topSegmentView
.
isHidden
=
scrollView
.
contentOffset
.
y
<
gap
self
.
topSegmentView
.
isHidden
=
scrollView
.
contentOffset
.
y
<
gap
// 滚动到哪个section 对应的segment要显示相应的index
// 滚动到哪个section 对应的segment要显示相应的index
// if items.count > 0 {
// var arr:[Double] = []
// for index in 0..<items.count {
// let rect = self.tableView.rectForHeader(inSection: index)
// let y = rect.origin.y-k_Height_NavigationtBarAndStatuBar-self.topSegmentHeight
// arr.append(y)
// }
//
// for (index, offY) in arr.reversed().enumerated() {
// if index == arr.count-1 {
// self.topSegmentView.updateSelectIndex(arr.count-index-1)
// self.segmentView.updateSelectIndex(arr.count-index-1)
// break
//
// } else {
// if scrollView.contentOffset.y >= offY+2 {
// self.topSegmentView.updateSelectIndex(arr.count-index-1)
// self.segmentView.updateSelectIndex(arr.count-index-1)
// break
// }
// }
// }
// }
var
find
:
Bool
=
false
if
items
.
count
>
0
{
if
items
.
count
>
0
{
var
arr
:[
Double
]
=
[]
for
index
in
0
..<
items
.
count
{
for
index
in
0
..<
items
.
count
{
let
rect
=
self
.
tableView
.
rectForHeader
(
inSection
:
index
)
let
rect
=
self
.
tableView
.
rectForHeader
(
inSection
:
index
)
let
y
=
rect
.
origin
.
y
-
k_Height_NavigationtBarAndStatuBar
-
self
.
topSegmentHeight
// section 到顶部选择tab的距离
arr
.
append
(
y
)
let
y
=
rect
.
origin
.
y
-
k_Height_NavigationtBarAndStatuBar
-
self
.
topSegmentHeight
+
24.0
-
self
.
tableView
.
contentOffset
.
y
if
0.0
<=
y
,
y
<
self
.
tableView
.
height
-
k_Height_NavigationtBarAndStatuBar
-
self
.
topSegmentHeight
{
for
(
index
,
offY
)
in
arr
.
reversed
()
.
enumerated
()
{
find
=
true
if
index
==
arr
.
count
-
1
{
self
.
topSegmentView
.
updateSelectIndex
(
index
)
self
.
topSegmentView
.
updateSelectIndex
(
arr
.
count
-
index
-
1
)
self
.
segmentView
.
updateSelectIndex
(
index
)
self
.
segmentView
.
updateSelectIndex
(
arr
.
count
-
index
-
1
)
break
break
}
else
{
if
scrollView
.
contentOffset
.
y
>=
offY
+
2
{
self
.
topSegmentView
.
updateSelectIndex
(
arr
.
count
-
index
-
1
)
self
.
segmentView
.
updateSelectIndex
(
arr
.
count
-
index
-
1
)
break
}
}
}
}
}
}
}
}
// section 没有在可见区域出现
if
!
find
{
if
let
arr
=
self
.
tableView
.
indexPathsForVisibleRows
,
let
lastIndexPath
=
arr
.
last
{
self
.
topSegmentView
.
updateSelectIndex
(
lastIndexPath
.
section
)
self
.
segmentView
.
updateSelectIndex
(
lastIndexPath
.
section
)
}
}
}
}
}
}
...
...
galaxy/galaxy/Classes/Modules/IntelligentService(服务中心)/FileList(文件清单)/V/YHSegmentView.swift
View file @
1f0ecf1f
...
@@ -101,7 +101,6 @@ class YHSegmentView: UIView {
...
@@ -101,7 +101,6 @@ class YHSegmentView: UIView {
let
selectIndex
=
view
.
tag
-
self
.
itemBaseTag
let
selectIndex
=
view
.
tag
-
self
.
itemBaseTag
self
.
selectIndex
=
selectIndex
self
.
selectIndex
=
selectIndex
self
.
selectBlock
?(
selectIndex
)
self
.
selectBlock
?(
selectIndex
)
updateSelectIndex
(
selectIndex
)
}
}
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment