Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
GMBase
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
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
gengmeiios
GMBase
Commits
aa147bcc
Commit
aa147bcc
authored
Mar 30, 2021
by
艾娇平
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
让jxPageView支持多组数据展示
parent
8254db69
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
12 deletions
+10
-12
JXPagerView.h
GMBase/Classes/JXPagerView/JXPagerView.h
+1
-0
JXPagerView.m
GMBase/Classes/JXPagerView/JXPagerView.m
+9
-12
No files found.
GMBase/Classes/JXPagerView/JXPagerView.h
View file @
aa147bcc
...
...
@@ -163,6 +163,7 @@
-
(
void
)
preferredProcessListViewDidScroll
:(
UIScrollView
*
)
scrollView
;
-
(
void
)
preferredProcessMainTableViewDidScroll
:(
UIScrollView
*
)
scrollView
;
// 获取listContainer的Cell
-
(
UITableViewCell
*
)
listContainerCellForRowAtIndexPath
:(
NSIndexPath
*
)
indexPath
;
-
(
CGFloat
)
listContainerCellHeight
;
...
...
GMBase/Classes/JXPagerView/JXPagerView.m
View file @
aa147bcc
...
...
@@ -43,7 +43,6 @@ static NSString *const kGM_ListCellIdentifier = @"gm_ListCellIdentifier";
self
.
mainTableView
.
dataSource
=
self
;
self
.
mainTableView
.
delegate
=
self
;
[
self
refreshTableHeaderView
];
[
self
.
mainTableView
registerClass
:[
UITableViewCell
class
]
forCellReuseIdentifier
:
@"cell"
];
[
self
.
mainTableView
registerClass
:[
UITableViewCell
class
]
forCellReuseIdentifier
:
kGM_ListCellIdentifier
];
if
(
@available
(
iOS
11
.
0
,
*
))
{
self
.
mainTableView
.
contentInsetAdjustmentBehavior
=
UIScrollViewContentInsetAdjustmentNever
;
...
...
@@ -70,7 +69,7 @@ static NSString *const kGM_ListCellIdentifier = @"gm_ListCellIdentifier";
-
(
void
)
reloadData
{
self
.
currentList
=
nil
;
self
.
currentScrollingListView
=
nil
;
self
.
listContainerCell
=
nil
;
for
(
id
<
JXPagerViewListViewDelegate
>
list
in
self
.
validListDict
.
allValues
)
{
[
list
.
listView
removeFromSuperview
];
}
...
...
@@ -139,14 +138,17 @@ static NSString *const kGM_ListCellIdentifier = @"gm_ListCellIdentifier";
-
(
UITableViewCell
*
)
listContainerCellForRowAtIndexPath
:
(
NSIndexPath
*
)
indexPath
{
UITableViewCell
*
cell
=
[
self
.
mainTableView
dequeueReusableCellWithIdentifier
:
kGM_ListCellIdentifier
forIndexPath
:
indexPath
];
UITableViewCell
*
cell
=
self
.
listContainerCell
;
if
(
!
cell
)
{
cell
=
[
self
.
mainTableView
dequeueReusableCellWithIdentifier
:
kGM_ListCellIdentifier
forIndexPath
:
indexPath
];
cell
.
selectionStyle
=
UITableViewCellSelectionStyleNone
;
self
.
listContainerCell
=
cell
;
for
(
UIView
*
view
in
cell
.
contentView
.
subviews
)
{
[
view
removeFromSuperview
];
}
self
.
listContainerView
.
frame
=
CGRectMake
(
0
,
0
,
cell
.
contentView
.
bounds
.
size
.
width
,
cell
.
contentView
.
bounds
.
size
.
height
-
0
);
self
.
listContainerView
.
frame
=
CGRectMake
(
0
,
0
,
cell
.
contentView
.
bounds
.
size
.
width
,
cell
.
contentView
.
bounds
.
size
.
height
);
[
cell
.
contentView
addSubview
:
self
.
listContainerView
];
}
return
cell
;
}
...
...
@@ -169,13 +171,8 @@ static NSString *const kGM_ListCellIdentifier = @"gm_ListCellIdentifier";
}
-
(
UITableViewCell
*
)
tableView
:
(
UITableView
*
)
tableView
cellForRowAtIndexPath
:
(
NSIndexPath
*
)
indexPath
{
UITableViewCell
*
cell
=
[
tableView
dequeueReusableCellWithIdentifier
:
@"cell"
forIndexPath
:
indexPath
];
for
(
UIView
*
view
in
cell
.
contentView
.
subviews
)
{
[
view
removeFromSuperview
];
}
self
.
listContainerView
.
frame
=
cell
.
contentView
.
bounds
;
[
cell
.
contentView
addSubview
:
self
.
listContainerView
];
return
cell
;
return
[
self
listContainerCellForRowAtIndexPath
:
indexPath
];
}
-
(
CGFloat
)
tableView
:
(
UITableView
*
)
tableView
heightForHeaderInSection
:
(
NSInteger
)
section
{
...
...
@@ -195,7 +192,7 @@ static NSString *const kGM_ListCellIdentifier = @"gm_ListCellIdentifier";
footer
.
backgroundColor
=
[
UIColor
clearColor
];
return
footer
;
}
#pragma mark - UIScrollViewDelegate
-
(
void
)
scrollViewDidScroll
:
(
UIScrollView
*
)
scrollView
{
if
(
self
.
mainTableView
.
mj_header
.
refreshing
)
{
...
...
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