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
eb0cd92a
Commit
eb0cd92a
authored
Jul 26, 2024
by
Steven杜宇
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
// 首页生活详情
parent
6712fdcf
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
49 additions
and
0 deletions
+49
-0
YHLifeDetailViewController.swift
...ules/Home(首页)/Life(生活)/C/YHLifeDetailViewController.swift
+49
-0
No files found.
galaxy/galaxy/Classes/Modules/Home(首页)/Life(生活)/C/YHLifeDetailViewController.swift
View file @
eb0cd92a
...
...
@@ -273,6 +273,31 @@ extension YHLifeDetailViewController: UIScrollViewDelegate {
topSegmentedView
.
isHidden
=
true
topLine
.
isHidden
=
true
}
var
find
=
false
if
self
.
imgItems
.
count
>
0
{
for
index
in
0
..<
self
.
imgItems
.
count
{
let
rect
=
self
.
tableView
.
rectForRow
(
at
:
IndexPath
(
row
:
index
,
section
:
0
))
// section 到顶部选择tab的距离
let
y
=
rect
.
origin
.
y
-
k_Height_NavigationtBarAndStatuBar
-
45.0
-
self
.
tableView
.
contentOffset
.
y
if
0.0
<=
y
,
y
<
self
.
tableView
.
height
-
k_Height_NavigationtBarAndStatuBar
-
45.0
{
find
=
true
self
.
topSegmentedView
.
defaultSelectedIndex
=
index
self
.
topSegmentedView
.
reloadDataWithoutListContainer
()
self
.
segmentedView
.
defaultSelectedIndex
=
index
self
.
segmentedView
.
reloadDataWithoutListContainer
()
break
}
}
}
// section 没有在可见区域出现
if
!
find
{
if
let
arr
=
self
.
tableView
.
indexPathsForVisibleRows
,
let
lastIndexPath
=
arr
.
last
{
self
.
topSegmentedView
.
defaultSelectedIndex
=
lastIndexPath
.
row
self
.
topSegmentedView
.
reloadDataWithoutListContainer
()
self
.
segmentedView
.
defaultSelectedIndex
=
lastIndexPath
.
row
self
.
segmentedView
.
reloadDataWithoutListContainer
()
}
}
}
}
...
...
@@ -314,6 +339,30 @@ extension YHLifeDetailViewController: UITableViewDataSource, UITableViewDelegate
func
tableView
(
_
tableView
:
UITableView
,
viewForFooterInSection
section
:
Int
)
->
UIView
?
{
return
UIView
()
}
func
tableView
(
_
tableView
:
UITableView
,
willDisplay
cell
:
UITableViewCell
,
forRowAt
indexPath
:
IndexPath
)
{
if
tableView
==
self
.
fakeTableView
{
return
}
if
0
<=
indexPath
.
row
,
indexPath
.
row
<
self
.
imgItems
.
count
{
self
.
segmentedView
.
defaultSelectedIndex
=
indexPath
.
row
self
.
segmentedView
.
reloadDataWithoutListContainer
()
self
.
topSegmentedView
.
defaultSelectedIndex
=
indexPath
.
row
self
.
topSegmentedView
.
reloadDataWithoutListContainer
()
}
}
func
tableView
(
_
tableView
:
UITableView
,
didEndDisplaying
cell
:
UITableViewCell
,
forRowAt
indexPath
:
IndexPath
)
{
if
tableView
==
self
.
fakeTableView
{
return
}
if
0
<=
indexPath
.
row
-
1
,
indexPath
.
row
-
1
<
self
.
imgItems
.
count
{
self
.
segmentedView
.
defaultSelectedIndex
=
indexPath
.
row
-
1
self
.
segmentedView
.
reloadDataWithoutListContainer
()
self
.
topSegmentedView
.
defaultSelectedIndex
=
indexPath
.
row
-
1
self
.
topSegmentedView
.
reloadDataWithoutListContainer
()
}
}
}
extension
YHLifeDetailViewController
{
...
...
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