Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Sign in / Register
Toggle navigation
P
PhoneManager
Project
Project
Details
Activity
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
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Yang
PhoneManager
Commits
78b769f8
Commit
78b769f8
authored
May 18, 2025
by
CZ1004
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
优化
parent
77c59570
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
1 deletion
+9
-1
HomeInfoView.swift
PhoneManager/Class/Page/Home/View/HomeInfoView.swift
+9
-1
No files found.
PhoneManager/Class/Page/Home/View/HomeInfoView.swift
View file @
78b769f8
...
@@ -13,6 +13,8 @@ class HomeInfoView :UIView {
...
@@ -13,6 +13,8 @@ class HomeInfoView :UIView {
var
titleText
:
String
?
var
titleText
:
String
?
var
isDragEnd
:
Bool
=
false
var
type
:
PhotsFileType
?
var
type
:
PhotsFileType
?
var
models
:[
HomeInfoTableItem
]
=
[]
var
models
:[
HomeInfoTableItem
]
=
[]
...
@@ -315,6 +317,7 @@ class HomeInfoView :UIView {
...
@@ -315,6 +317,7 @@ class HomeInfoView :UIView {
extension
HomeInfoView
:
UITableViewDataSource
,
UITableViewDelegate
{
extension
HomeInfoView
:
UITableViewDataSource
,
UITableViewDelegate
{
@objc
func
nextRowButtonAction
(){
@objc
func
nextRowButtonAction
(){
self
.
tableScrollToNextRow
()
self
.
tableScrollToNextRow
()
}
}
...
@@ -351,7 +354,7 @@ extension HomeInfoView:UITableViewDataSource,UITableViewDelegate {
...
@@ -351,7 +354,7 @@ extension HomeInfoView:UITableViewDataSource,UITableViewDelegate {
guard
let
indexPath
=
tableView
.
indexPathsForVisibleRows
?
.
first
else
{
return
}
guard
let
indexPath
=
tableView
.
indexPathsForVisibleRows
?
.
first
else
{
return
}
let
nextRow
=
indexPath
.
row
+
1
let
nextRow
=
self
.
isDragEnd
==
true
?
indexPath
.
row
+
1
:
indexPath
.
row
+
2
let
nextSection
=
indexPath
.
section
let
nextSection
=
indexPath
.
section
// 检查下一行是否存在
// 检查下一行是否存在
...
@@ -370,6 +373,7 @@ extension HomeInfoView:UITableViewDataSource,UITableViewDelegate {
...
@@ -370,6 +373,7 @@ extension HomeInfoView:UITableViewDataSource,UITableViewDelegate {
// 直接滚动到调整后的位置
// 直接滚动到调整后的位置
tableView
.
setContentOffset
(
adjustedOffset
,
animated
:
true
)
tableView
.
setContentOffset
(
adjustedOffset
,
animated
:
true
)
self
.
isDragEnd
=
false
}
}
func
scrollViewDidScroll
(
_
scrollView
:
UIScrollView
)
{
func
scrollViewDidScroll
(
_
scrollView
:
UIScrollView
)
{
...
@@ -386,6 +390,10 @@ extension HomeInfoView:UITableViewDataSource,UITableViewDelegate {
...
@@ -386,6 +390,10 @@ extension HomeInfoView:UITableViewDataSource,UITableViewDelegate {
tableView
.
bringSubviewToFront
(
self
.
headerView
)
tableView
.
bringSubviewToFront
(
self
.
headerView
)
}
}
func
scrollViewDidEndDragging
(
_
scrollView
:
UIScrollView
,
willDecelerate
decelerate
:
Bool
)
{
self
.
isDragEnd
=
true
}
func
tableView
(
_
tableView
:
UITableView
,
numberOfRowsInSection
section
:
Int
)
->
Int
{
func
tableView
(
_
tableView
:
UITableView
,
numberOfRowsInSection
section
:
Int
)
->
Int
{
return
models
.
count
return
models
.
count
...
...
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