Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
D
DZXCarouselView
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
lufei
DZXCarouselView
Commits
2bf28498
Commit
2bf28498
authored
Apr 21, 2021
by
lufei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
modify:修复在索引为0位置,往左划,索引错误的bug;优化setdataarr后pagecontrol控件也置0
parent
18b33d2d
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
3 deletions
+6
-3
DZXCarouselView/Classes/DZXCarouselView.m
DZXCarouselView/Classes/DZXCarouselView.m
+6
-3
No files found.
DZXCarouselView/Classes/DZXCarouselView.m
View file @
2bf28498
...
...
@@ -237,7 +237,7 @@ static BOOL isScrolling = NO;
-
(
void
)
scroll
{
if
(
_dataArr
.
count
>
1
)
{
if
(
_isLast
)
{
self
.
currentIndex
=
(
_currentIndex
-
1
)
%
_dataArr
.
count
;
self
.
currentIndex
=
(
_currentIndex
-
1
+
_dataArr
.
count
)
%
_dataArr
.
count
;
}
else
{
self
.
currentIndex
=
(
_currentIndex
+
1
)
%
_dataArr
.
count
;
}
...
...
@@ -248,7 +248,7 @@ static BOOL isScrolling = NO;
}
//更新内容
-
(
void
)
updateViewData
{
[
self
addProperty
:
_dataArr
[(
_currentIndex
-
1
)
%
_dataArr
.
count
]
toObj
:
_lastV
];
[
self
addProperty
:
_dataArr
[(
_currentIndex
-
1
+
_dataArr
.
count
)
%
_dataArr
.
count
]
toObj
:
_lastV
];
[
self
addProperty
:
_dataArr
[
_currentIndex
]
toObj
:
_currentV
];
[
self
addProperty
:
_dataArr
[(
_currentIndex
+
1
)
%
_dataArr
.
count
]
toObj
:
_nextV
];
...
...
@@ -362,7 +362,7 @@ static BOOL isScrolling = NO;
if
(
_currentIndex
<
0
||
_currentIndex
>=
_dataArr
.
count
)
return
;
NSInteger
willShowIndex
;
if
(
isLast
)
{
willShowIndex
=
(
_currentIndex
-
1
)
%
_dataArr
.
count
;
willShowIndex
=
(
_currentIndex
-
1
+
_dataArr
.
count
)
%
_dataArr
.
count
;
}
else
{
willShowIndex
=
(
_currentIndex
+
1
)
%
_dataArr
.
count
;
}
...
...
@@ -418,6 +418,9 @@ static BOOL isScrolling = NO;
//页面展示block(第一次进来)
_pageWillShowBlock
(
0
,
_dataArr
[
0
]);
_pageShowBlock
(
0
,
_dataArr
[
0
]);
if
(
_carouselConfig
.
showPageControl
)
{
_pageControl
.
currentPage
=
0
;
}
}
@end
...
...
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