Procházet zdrojové kódy

滚动条目高度适配

薛鸿潇 před 5 roky
rodič
revize
1b4a3ff3ec

+ 307 - 210
assets/resources/module/redBagCash/redBagCash.prefab

@@ -19,25 +19,22 @@
     "_children": [
       {
         "__id__": 2
-      },
-      {
-        "__id__": 55
       }
     ],
     "_active": true,
     "_components": [
       {
-        "__id__": 61
+        "__id__": 64
       },
       {
-        "__id__": 62
+        "__id__": 65
       },
       {
-        "__id__": 63
+        "__id__": 66
       }
     ],
     "_prefab": {
-      "__id__": 64
+      "__id__": 67
     },
     "_opacity": 255,
     "_color": {
@@ -101,17 +98,17 @@
         "__id__": 6
       },
       {
-        "__id__": 44
+        "__id__": 51
       }
     ],
     "_active": true,
     "_components": [
       {
-        "__id__": 53
+        "__id__": 62
       }
     ],
     "_prefab": {
-      "__id__": 54
+      "__id__": 63
     },
     "_opacity": 255,
     "_color": {
@@ -292,12 +289,19 @@
       },
       {
         "__id__": 39
+      },
+      {
+        "__id__": 43
       }
     ],
     "_active": true,
-    "_components": [],
+    "_components": [
+      {
+        "__id__": 49
+      }
+    ],
     "_prefab": {
-      "__id__": 43
+      "__id__": 50
     },
     "_opacity": 255,
     "_color": {
@@ -1614,39 +1618,25 @@
     "sync": false
   },
   {
-    "__type__": "cc.PrefabInfo",
-    "root": {
-      "__id__": 1
-    },
-    "asset": {
-      "__uuid__": "0d6e8f52-d995-4831-a8cc-2f1ed873243f"
-    },
-    "fileId": "36fIKc+T9ChKFV6apudmDa",
-    "sync": false
-  },
-  {
     "__type__": "cc.Node",
-    "_name": "滚动视图",
+    "_name": "关闭按钮",
     "_objFlags": 0,
     "_parent": {
-      "__id__": 2
+      "__id__": 6
     },
     "_children": [
       {
-        "__id__": 45
+        "__id__": 44
       }
     ],
     "_active": true,
     "_components": [
       {
-        "__id__": 50
-      },
-      {
-        "__id__": 51
+        "__id__": 47
       }
     ],
     "_prefab": {
-      "__id__": 52
+      "__id__": 48
     },
     "_opacity": 255,
     "_color": {
@@ -1658,8 +1648,8 @@
     },
     "_contentSize": {
       "__type__": "cc.Size",
-      "width": 700,
-      "height": 820
+      "width": 100,
+      "height": 100
     },
     "_anchorPoint": {
       "__type__": "cc.Vec2",
@@ -1670,8 +1660,8 @@
       "__type__": "TypedArray",
       "ctor": "Float64Array",
       "array": [
-        0,
-        -153.891,
+        323.124,
+        580.988,
         0,
         0,
         0,
@@ -1697,24 +1687,20 @@
   },
   {
     "__type__": "cc.Node",
-    "_name": "view",
+    "_name": "按钮纹理",
     "_objFlags": 0,
     "_parent": {
-      "__id__": 44
+      "__id__": 43
     },
-    "_children": [
-      {
-        "__id__": 46
-      }
-    ],
+    "_children": [],
     "_active": true,
     "_components": [
       {
-        "__id__": 48
+        "__id__": 45
       }
     ],
     "_prefab": {
-      "__id__": 49
+      "__id__": 46
     },
     "_opacity": 255,
     "_color": {
@@ -1726,8 +1712,8 @@
     },
     "_contentSize": {
       "__type__": "cc.Size",
-      "width": 700,
-      "height": 820
+      "width": 53,
+      "height": 49
     },
     "_anchorPoint": {
       "__type__": "cc.Vec2",
@@ -1764,82 +1750,11 @@
     "_id": ""
   },
   {
-    "__type__": "cc.Node",
-    "_name": "content",
-    "_objFlags": 0,
-    "_parent": {
-      "__id__": 45
-    },
-    "_children": [],
-    "_active": true,
-    "_components": [],
-    "_prefab": {
-      "__id__": 47
-    },
-    "_opacity": 255,
-    "_color": {
-      "__type__": "cc.Color",
-      "r": 255,
-      "g": 255,
-      "b": 255,
-      "a": 255
-    },
-    "_contentSize": {
-      "__type__": "cc.Size",
-      "width": 700,
-      "height": 820
-    },
-    "_anchorPoint": {
-      "__type__": "cc.Vec2",
-      "x": 0.5,
-      "y": 1
-    },
-    "_trs": {
-      "__type__": "TypedArray",
-      "ctor": "Float64Array",
-      "array": [
-        0,
-        410,
-        0,
-        0,
-        0,
-        0,
-        1,
-        1,
-        1,
-        1
-      ]
-    },
-    "_eulerAngles": {
-      "__type__": "cc.Vec3",
-      "x": 0,
-      "y": 0,
-      "z": 0
-    },
-    "_skewX": 0,
-    "_skewY": 0,
-    "_is3DNode": false,
-    "_groupIndex": 0,
-    "groupIndex": 0,
-    "_id": ""
-  },
-  {
-    "__type__": "cc.PrefabInfo",
-    "root": {
-      "__id__": 1
-    },
-    "asset": {
-      "__uuid__": "0d6e8f52-d995-4831-a8cc-2f1ed873243f"
-    },
-    "fileId": "23C9qBHy5J0LPWl52z+fix",
-    "sync": false
-  },
-  {
-    "__type__": "cc.Mask",
+    "__type__": "cc.Sprite",
     "_name": "",
     "_objFlags": 0,
     "node": {
-      "__id__": 45
+      "__id__": 44
     },
     "_enabled": true,
     "_materials": [
@@ -1847,11 +1762,23 @@
         "__uuid__": "eca5d2f2-8ef6-41c2-bbe6-f9c79d09c432"
       }
     ],
-    "_spriteFrame": null,
+    "_srcBlendFactor": 770,
+    "_dstBlendFactor": 771,
+    "_spriteFrame": {
+      "__uuid__": "b4206a15-49d3-44ee-abdf-9f76c13ed88a"
+    },
     "_type": 0,
-    "_segments": 64,
-    "_N$alphaThreshold": 0,
-    "_N$inverted": false,
+    "_sizeMode": 1,
+    "_fillType": 0,
+    "_fillCenter": {
+      "__type__": "cc.Vec2",
+      "x": 0,
+      "y": 0
+    },
+    "_fillStart": 0,
+    "_fillRange": 0,
+    "_isTrimmedMode": true,
+    "_atlas": null,
     "_id": ""
   },
   {
@@ -1862,52 +1789,22 @@
     "asset": {
       "__uuid__": "0d6e8f52-d995-4831-a8cc-2f1ed873243f"
     },
-    "fileId": "d92jIPOwdDeYL95JVJ3nM2",
+    "fileId": "885sx6y2pNdKsFACSxQn6j",
     "sync": false
   },
   {
-    "__type__": "cc.ScrollView",
+    "__type__": "cdc50kCRVVBa5gcp4XXxVO+",
     "_name": "",
     "_objFlags": 0,
     "node": {
-      "__id__": 44
+      "__id__": 43
     },
     "_enabled": true,
-    "horizontal": false,
-    "vertical": true,
-    "inertia": true,
-    "brake": 0.75,
-    "elastic": true,
-    "bounceDuration": 0.23,
-    "scrollEvents": [],
-    "cancelInnerEvents": false,
-    "_N$content": {
-      "__id__": 46
-    },
-    "content": {
-      "__id__": 46
-    },
-    "_N$horizontalScrollBar": null,
-    "_N$verticalScrollBar": null,
-    "_id": ""
-  },
-  {
-    "__type__": "9a31drXM+9NCKYkF9D78zlF",
-    "_name": "",
-    "_objFlags": 0,
-    "node": {
-      "__id__": 44
+    "node_panel": {
+      "__id__": 1
     },
-    "_enabled": true,
-    "pre_item": [
-      {
-        "__uuid__": "0b23b166-73c8-46f2-a990-09f1832c3c24"
-      }
-    ],
-    "scr_item": [
-      "RedBagCashItem"
-    ],
-    "itemInterval": 20,
+    "transition_type": 3,
+    "onComplete": [],
     "_id": ""
   },
   {
@@ -1918,7 +1815,7 @@
     "asset": {
       "__uuid__": "0d6e8f52-d995-4831-a8cc-2f1ed873243f"
     },
-    "fileId": "37kghNAYtJqZpuKbRIT3Qw",
+    "fileId": "4cQThSyptHConKfbVZWWS6",
     "sync": false
   },
   {
@@ -1926,15 +1823,17 @@
     "_name": "",
     "_objFlags": 0,
     "node": {
-      "__id__": 2
+      "__id__": 6
     },
     "_enabled": true,
     "alignMode": 1,
-    "_target": null,
-    "_alignFlags": 45,
+    "_target": {
+      "__id__": 1
+    },
+    "_alignFlags": 1,
     "_left": 0,
     "_right": 0,
-    "_top": 0,
+    "_top": 667,
     "_bottom": 0,
     "_verticalCenter": 0,
     "_horizontalCenter": 0,
@@ -1956,29 +1855,35 @@
     "asset": {
       "__uuid__": "0d6e8f52-d995-4831-a8cc-2f1ed873243f"
     },
-    "fileId": "94yiGj0RFACpXt5xGEvfHf",
+    "fileId": "36fIKc+T9ChKFV6apudmDa",
     "sync": false
   },
   {
     "__type__": "cc.Node",
-    "_name": "关闭按钮",
+    "_name": "滚动视图",
     "_objFlags": 0,
     "_parent": {
-      "__id__": 1
+      "__id__": 2
     },
     "_children": [
       {
-        "__id__": 56
+        "__id__": 52
       }
     ],
     "_active": true,
     "_components": [
       {
+        "__id__": 58
+      },
+      {
         "__id__": 59
+      },
+      {
+        "__id__": 60
       }
     ],
     "_prefab": {
-      "__id__": 60
+      "__id__": 61
     },
     "_opacity": 255,
     "_color": {
@@ -1990,20 +1895,20 @@
     },
     "_contentSize": {
       "__type__": "cc.Size",
-      "width": 100,
-      "height": 100
+      "width": 700,
+      "height": 820
     },
     "_anchorPoint": {
       "__type__": "cc.Vec2",
       "x": 0.5,
-      "y": 0.5
+      "y": 1
     },
     "_trs": {
       "__type__": "TypedArray",
       "ctor": "Float64Array",
       "array": [
-        323.124,
-        580.988,
+        0,
+        252.26599999999996,
         0,
         0,
         0,
@@ -2029,20 +1934,27 @@
   },
   {
     "__type__": "cc.Node",
-    "_name": "按钮纹理",
+    "_name": "view",
     "_objFlags": 0,
     "_parent": {
-      "__id__": 55
+      "__id__": 51
     },
-    "_children": [],
+    "_children": [
+      {
+        "__id__": 53
+      }
+    ],
     "_active": true,
     "_components": [
       {
-        "__id__": 57
+        "__id__": 55
+      },
+      {
+        "__id__": 56
       }
     ],
     "_prefab": {
-      "__id__": 58
+      "__id__": 57
     },
     "_opacity": 255,
     "_color": {
@@ -2054,13 +1966,13 @@
     },
     "_contentSize": {
       "__type__": "cc.Size",
-      "width": 53,
-      "height": 49
+      "width": 700,
+      "height": 820
     },
     "_anchorPoint": {
       "__type__": "cc.Vec2",
       "x": 0.5,
-      "y": 0.5
+      "y": 1
     },
     "_trs": {
       "__type__": "TypedArray",
@@ -2092,11 +2004,111 @@
     "_id": ""
   },
   {
-    "__type__": "cc.Sprite",
+    "__type__": "cc.Node",
+    "_name": "content",
+    "_objFlags": 0,
+    "_parent": {
+      "__id__": 52
+    },
+    "_children": [],
+    "_active": true,
+    "_components": [],
+    "_prefab": {
+      "__id__": 54
+    },
+    "_opacity": 255,
+    "_color": {
+      "__type__": "cc.Color",
+      "r": 255,
+      "g": 255,
+      "b": 255,
+      "a": 255
+    },
+    "_contentSize": {
+      "__type__": "cc.Size",
+      "width": 700,
+      "height": 820
+    },
+    "_anchorPoint": {
+      "__type__": "cc.Vec2",
+      "x": 0.5,
+      "y": 1
+    },
+    "_trs": {
+      "__type__": "TypedArray",
+      "ctor": "Float64Array",
+      "array": [
+        0,
+        0,
+        0,
+        0,
+        0,
+        0,
+        1,
+        1,
+        1,
+        1
+      ]
+    },
+    "_eulerAngles": {
+      "__type__": "cc.Vec3",
+      "x": 0,
+      "y": 0,
+      "z": 0
+    },
+    "_skewX": 0,
+    "_skewY": 0,
+    "_is3DNode": false,
+    "_groupIndex": 0,
+    "groupIndex": 0,
+    "_id": ""
+  },
+  {
+    "__type__": "cc.PrefabInfo",
+    "root": {
+      "__id__": 1
+    },
+    "asset": {
+      "__uuid__": "0d6e8f52-d995-4831-a8cc-2f1ed873243f"
+    },
+    "fileId": "23C9qBHy5J0LPWl52z+fix",
+    "sync": false
+  },
+  {
+    "__type__": "cc.Widget",
     "_name": "",
     "_objFlags": 0,
     "node": {
-      "__id__": 56
+      "__id__": 52
+    },
+    "_enabled": true,
+    "alignMode": 1,
+    "_target": {
+      "__id__": 51
+    },
+    "_alignFlags": 5,
+    "_left": 0,
+    "_right": 0,
+    "_top": 0,
+    "_bottom": 0,
+    "_verticalCenter": 0,
+    "_horizontalCenter": 0,
+    "_isAbsLeft": true,
+    "_isAbsRight": true,
+    "_isAbsTop": true,
+    "_isAbsBottom": true,
+    "_isAbsHorizontalCenter": true,
+    "_isAbsVerticalCenter": true,
+    "_originalWidth": 0,
+    "_originalHeight": 820,
+    "_id": ""
+  },
+  {
+    "__type__": "cc.Mask",
+    "_name": "",
+    "_objFlags": 0,
+    "node": {
+      "__id__": 52
     },
     "_enabled": true,
     "_materials": [
@@ -2104,23 +2116,11 @@
         "__uuid__": "eca5d2f2-8ef6-41c2-bbe6-f9c79d09c432"
       }
     ],
-    "_srcBlendFactor": 770,
-    "_dstBlendFactor": 771,
-    "_spriteFrame": {
-      "__uuid__": "b4206a15-49d3-44ee-abdf-9f76c13ed88a"
-    },
+    "_spriteFrame": null,
     "_type": 0,
-    "_sizeMode": 1,
-    "_fillType": 0,
-    "_fillCenter": {
-      "__type__": "cc.Vec2",
-      "x": 0,
-      "y": 0
-    },
-    "_fillStart": 0,
-    "_fillRange": 0,
-    "_isTrimmedMode": true,
-    "_atlas": null,
+    "_segments": 64,
+    "_N$alphaThreshold": 0,
+    "_N$inverted": false,
     "_id": ""
   },
   {
@@ -2131,22 +2131,81 @@
     "asset": {
       "__uuid__": "0d6e8f52-d995-4831-a8cc-2f1ed873243f"
     },
-    "fileId": "2fogzjyg1Eeb4o3xdTj4nf",
+    "fileId": "d92jIPOwdDeYL95JVJ3nM2",
     "sync": false
   },
   {
-    "__type__": "cdc50kCRVVBa5gcp4XXxVO+",
+    "__type__": "cc.Widget",
     "_name": "",
     "_objFlags": 0,
     "node": {
-      "__id__": 55
+      "__id__": 51
     },
     "_enabled": true,
-    "node_panel": {
+    "alignMode": 1,
+    "_target": {
       "__id__": 1
     },
-    "transition_type": 3,
-    "onComplete": [],
+    "_alignFlags": 5,
+    "_left": 0,
+    "_right": 0,
+    "_top": 414.73400000000004,
+    "_bottom": 99.26599999999996,
+    "_verticalCenter": 0,
+    "_horizontalCenter": 0,
+    "_isAbsLeft": true,
+    "_isAbsRight": true,
+    "_isAbsTop": true,
+    "_isAbsBottom": true,
+    "_isAbsHorizontalCenter": true,
+    "_isAbsVerticalCenter": true,
+    "_originalWidth": 0,
+    "_originalHeight": 820,
+    "_id": ""
+  },
+  {
+    "__type__": "cc.ScrollView",
+    "_name": "",
+    "_objFlags": 0,
+    "node": {
+      "__id__": 51
+    },
+    "_enabled": true,
+    "horizontal": false,
+    "vertical": true,
+    "inertia": true,
+    "brake": 0.75,
+    "elastic": true,
+    "bounceDuration": 0.23,
+    "scrollEvents": [],
+    "cancelInnerEvents": false,
+    "_N$content": {
+      "__id__": 53
+    },
+    "content": {
+      "__id__": 53
+    },
+    "_N$horizontalScrollBar": null,
+    "_N$verticalScrollBar": null,
+    "_id": ""
+  },
+  {
+    "__type__": "9a31drXM+9NCKYkF9D78zlF",
+    "_name": "",
+    "_objFlags": 0,
+    "node": {
+      "__id__": 51
+    },
+    "_enabled": true,
+    "pre_item": [
+      {
+        "__uuid__": "0b23b166-73c8-46f2-a990-09f1832c3c24"
+      }
+    ],
+    "scr_item": [
+      "RedBagCashItem"
+    ],
+    "itemInterval": 20,
     "_id": ""
   },
   {
@@ -2157,7 +2216,45 @@
     "asset": {
       "__uuid__": "0d6e8f52-d995-4831-a8cc-2f1ed873243f"
     },
-    "fileId": "c8jvBP2fNFRbU3kLiQJ9Sl",
+    "fileId": "37kghNAYtJqZpuKbRIT3Qw",
+    "sync": false
+  },
+  {
+    "__type__": "cc.Widget",
+    "_name": "",
+    "_objFlags": 0,
+    "node": {
+      "__id__": 2
+    },
+    "_enabled": true,
+    "alignMode": 1,
+    "_target": null,
+    "_alignFlags": 45,
+    "_left": 0,
+    "_right": 0,
+    "_top": 0,
+    "_bottom": 0,
+    "_verticalCenter": 0,
+    "_horizontalCenter": 0,
+    "_isAbsLeft": true,
+    "_isAbsRight": true,
+    "_isAbsTop": true,
+    "_isAbsBottom": true,
+    "_isAbsHorizontalCenter": true,
+    "_isAbsVerticalCenter": true,
+    "_originalWidth": 0,
+    "_originalHeight": 0,
+    "_id": ""
+  },
+  {
+    "__type__": "cc.PrefabInfo",
+    "root": {
+      "__id__": 1
+    },
+    "asset": {
+      "__uuid__": "0d6e8f52-d995-4831-a8cc-2f1ed873243f"
+    },
+    "fileId": "94yiGj0RFACpXt5xGEvfHf",
     "sync": false
   },
   {
@@ -2196,10 +2293,10 @@
     },
     "_enabled": true,
     "sroll_view": {
-      "__id__": 50
+      "__id__": 59
     },
     "node_content": {
-      "__id__": 46
+      "__id__": 53
     },
     "lbl_redbag": {
       "__id__": 15

+ 3 - 1
assets/script/game/module/redBagCash/RedBagCash.ts

@@ -42,7 +42,9 @@ export default class RedBagCash extends cc.Component {
         this.sroll_view.node.emit('srollview-init', gData.redBagCash.c_data);
         gData.redBagCash.init_list = false;
         // 条目动画
-        this.itemAnim();
+        this.scheduleOnce(() => {
+            this.itemAnim();
+        }, 0)
     }
 
     private itemAnim() {