diff --git a/Assets/ManagedResources/~Lua/View/ScrollCycleView.lua b/Assets/ManagedResources/~Lua/View/ScrollCycleView.lua index 744e418fc4..2f65acbba2 100644 --- a/Assets/ManagedResources/~Lua/View/ScrollCycleView.lua +++ b/Assets/ManagedResources/~Lua/View/ScrollCycleView.lua @@ -269,7 +269,7 @@ function ScrollCycleView:OnOpen(itemGO, scrollBar, scrollSizeDeltaV2, dragType, end end -function this:SetData(dataList, updateFunc, isTop, noAnim) +function this:SetData(dataList, updateFunc, noTop, noAnim) self.dataList = dataList --传入的数据列表 self.updateFunc = updateFunc --刷新回调,返回数据列表的索引和对应预设 self.dataCount = #dataList @@ -291,11 +291,11 @@ function this:SetData(dataList, updateFunc, isTop, noAnim) end -- 判断是否回到顶部,否则保持不动 - if isTop then - self:SetShow(1) - else + if noTop then local showIndex = self:CalShowIndex() self:SetShow(showIndex) + else + self:SetShow(1) end end