|
|
@@ -30,6 +30,12 @@ export default class TableView extends cc.Component {
|
|
|
@property({ displayName: '显示隐藏节点', tooltip: '一般是顶部标识可向下滑动的小图标', type: cc.Node })
|
|
|
private node_xiabiao: cc.Node = null;
|
|
|
|
|
|
+ @property({displayName: '上面的节点是否根据指定数据的长度来控制显示,优先级最高'})
|
|
|
+ private isShowByLimitLength: boolean = false;
|
|
|
+ @property({displayName: '长度值', visible(){return this.isShowByLimitLength}})
|
|
|
+ private limitLength: number = 0;
|
|
|
+
|
|
|
+
|
|
|
@property({ displayName: '滚动方向', tooltip: '', type: cc.Enum(Direction) })
|
|
|
private direction = Direction.vertical;
|
|
|
|
|
|
@@ -71,6 +77,9 @@ export default class TableView extends cc.Component {
|
|
|
this.scrollView.vertical = false;
|
|
|
this.scrollView.horizontal = true;
|
|
|
}
|
|
|
+
|
|
|
+ if(this.node_xiabiao)
|
|
|
+ this.node_xiabiao.active = false;
|
|
|
// 测试
|
|
|
// let itemData = [];
|
|
|
// for (let i = 0; i < 20; i++) {
|
|
|
@@ -173,6 +182,15 @@ export default class TableView extends cc.Component {
|
|
|
if (!this.node_xiabiao)
|
|
|
return;
|
|
|
|
|
|
+ if(this.isShowByLimitLength)
|
|
|
+ {
|
|
|
+ if(this.itemData.length <= this.limitLength)
|
|
|
+ {
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
if (this.content.height > this.layerHeight) {
|
|
|
if (this.scrollView.getScrollOffset().y >= this.scrollView.getMaxScrollOffset().y) {
|
|
|
if (this.node_xiabiao.active == true)
|