Skip to content

Commit f62158b

Browse files
author
石破天惊
authored
Merge pull request #59 from bolan9999/develop
Bug Fix:
2 parents a544edf + 3e064ef commit f62158b

File tree

10 files changed

+1403
-1394
lines changed

10 files changed

+1403
-1394
lines changed

App.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,9 +44,9 @@ export default class App extends React.Component {
4444
/>
4545
);
4646
case 3:
47-
return <LargeListSample2 style={{ flex: 1 }} />;
47+
return <LargeListSample2 style={{ flex: 1, marginTop:40 }} />;
4848
case 4:
49-
return <LargeListSample3 style={{ flex: 1 }} />;
49+
return <LargeListSample3 style={{ flex: 1, marginTop:40 }} />;
5050
case 5:
5151
return <LargeListSample4/>
5252
}

README-cn.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -344,6 +344,9 @@ onScroll | ({nativeEvent:{contentOffset:{x:number,y:number}}})=> any | | 滑动
344344

345345
## 更新日志
346346

347+
### 版本 1.2.4
348+
* 修复初始化时是空视图,numberOfCellPoolSize默认值过小的问题
349+
347350
### 版本 1.2.3
348351
* 修复TypeScript类型声明错误
349352

README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -336,6 +336,9 @@ Get LargeList's footer height
336336

337337
## Update Log
338338

339+
### Version 1.2.4
340+
* Fix default numberOfCellPoolSize error when empty.
341+
339342
### Version 1.2.3
340343
* Fix typescript type define.
341344

ios/LargeListDemo/AppDelegate.m

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@ - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(
1818
{
1919
NSURL *jsCodeLocation;
2020
#ifdef DEBUG
21-
jsCodeLocation = [NSURL URLWithString:@"http://10.16.64.93:8081/index.bundle?platform=ios&dev=true"];
22-
// jsCodeLocation = [NSURL URLWithString:@"http://192.168.1.103:8081/index.bundle?platform=ios&dev=true"];
21+
// jsCodeLocation = [NSURL URLWithString:@"http://10.16.64.93:8081/index.bundle?platform=ios&dev=true"];
22+
jsCodeLocation = [NSURL URLWithString:@"http://192.168.1.103:8081/index.bundle?platform=ios&dev=true"];
2323
// jsCodeLocation = [NSURL URLWithString:@"http://172.20.10.4:8081/index.bundle?platform=ios&dev=true"];
2424
#else
2525
jsCodeLocation = [[NSBundle mainBundle] URLForResource:@"main" withExtension:@"jsbundle"];

react-native-largelist/largelist/LargeList.js

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -211,8 +211,8 @@ class LargeList extends React.Component {
211211
this.contentSize = { width: 0, height: 0 };
212212
this.lastScrollTime = 0;
213213
this.currentSection = 0;
214-
this.minCellHeight = 100;
215-
this.minSectionHeight = 100;
214+
this.minCellHeight = 40;
215+
this.minSectionHeight = 40;
216216
this.sizeConfirmed = false;
217217
this.headerHeight = null;
218218
this.footerHeight = null;
@@ -513,7 +513,8 @@ class LargeList extends React.Component {
513513
});
514514
this.workRefs.forEach(item => {
515515
if (this._compareIndexPath(item.indexPath, this.topIndexPath) < 0) {
516-
this.freeRefs.splice(0, 0, item);
516+
// this.freeRefs.splice(0, 0, item);
517+
this.freeRefs.push(item);
517518
}
518519
});
519520
this.freeRefs.forEach(cell => {
@@ -627,7 +628,8 @@ class LargeList extends React.Component {
627628

628629
this.workRefs.forEach(item => {
629630
if (this._compareIndexPath(item.indexPath, this.bottomIndexPath) > 0) {
630-
this.freeRefs.splice(0, 0, item);
631+
// this.freeRefs.splice(0, 0, item);
632+
this.freeRefs.push(item);
631633
}
632634
});
633635
this.freeRefs.forEach(cell => {
@@ -1017,7 +1019,8 @@ class LargeList extends React.Component {
10171019
this.initVar();
10181020
this.safeArea = { top: 0, bottom: 0 };
10191021
this.workRefs.forEach(cell => {
1020-
this.freeRefs.splice(0, 0, cell);
1022+
// this.freeRefs.splice(0, 0, cell);
1023+
this.freeRefs.push(cell);
10211024
});
10221025
this.freeRefs.forEach(cell => {
10231026
cell.waitForRender = true;

react-native-largelist/largelist/LargeListCell.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ class LargeListCell extends React.Component {
127127
render() {
128128
let { section, row } = this.indexPath;
129129
let show =
130-
this.top !== -10000 &&
130+
// this.top !== -10000 &&
131131
section >= 0 &&
132132
section < this.props.numberOfSections() &&
133133
row >= 0 &&
@@ -140,6 +140,7 @@ class LargeListCell extends React.Component {
140140
>
141141
{show &&
142142
this.props.renderCell(this.indexPath.section, this.indexPath.row)}
143+
{show && this._renderItemSeparator()}
143144
</View>
144145
);
145146
let contentStyle = this.contentSize.width

0 commit comments

Comments
 (0)