奖励界面
This commit is contained in:
parent
6e20c37abf
commit
6c738a5641
@ -1,14 +1,8 @@
|
|||||||
local BaseTips = require "app/ui/tips/base_tips"
|
local BaseTips = require "app/ui/tips/base_tips"
|
||||||
local RewardBox = class("RewardBox", BaseTips)
|
local RewardBox = class("RewardBox", BaseTips)
|
||||||
|
|
||||||
local CELL_WIDTH = 151
|
local CELL_WIDTH = 130
|
||||||
local CELL_NUM = 5
|
local CELL_NUM = 5
|
||||||
local MIN_SIZE_Y = 426
|
|
||||||
local MAX_SIZE_Y = 966
|
|
||||||
local MAX_SIZE_X = 690
|
|
||||||
|
|
||||||
local MIN_TITLE_POS_Y = 264
|
|
||||||
local MAX_TITLE_POS_Y = 540
|
|
||||||
|
|
||||||
function RewardBox:ctor(params)
|
function RewardBox:ctor(params)
|
||||||
self.params = params or {}
|
self.params = params or {}
|
||||||
@ -50,20 +44,13 @@ end
|
|||||||
|
|
||||||
function RewardBox:_refreshScrollRect()
|
function RewardBox:_refreshScrollRect()
|
||||||
if #self.params.rewards <= 5 then
|
if #self.params.rewards <= 5 then
|
||||||
self.scrollView:setSizeDelta(#self.params.rewards*CELL_WIDTH, MIN_SIZE_Y)
|
self.scrollView:setSizeDeltaX(#self.params.rewards*CELL_WIDTH)
|
||||||
self.scrollRect:setPerLineNum(#self.params.rewards)
|
self.scrollRect:setPerLineNum(#self.params.rewards)
|
||||||
self.scrollRect:refillCells(#self.params.rewards, true)
|
self.scrollRect:refillCells(#self.params.rewards, true)
|
||||||
self.titleTx:setAnchoredPositionY(MIN_TITLE_POS_Y)
|
else
|
||||||
elseif #self.params.rewards <= 15 then
|
self.scrollView:setSizeDeltaX(CELL_WIDTH*5)
|
||||||
self.scrollView:setSizeDelta(MAX_SIZE_X, MIN_SIZE_Y)
|
|
||||||
self.scrollRect:setPerLineNum(CELL_NUM)
|
self.scrollRect:setPerLineNum(CELL_NUM)
|
||||||
self.scrollRect:refillCells(#self.params.rewards, true)
|
self.scrollRect:refillCells(#self.params.rewards, true)
|
||||||
self.titleTx:setAnchoredPositionY(MIN_TITLE_POS_Y)
|
|
||||||
else
|
|
||||||
self.scrollView:setSizeDelta(MAX_SIZE_X, MAX_SIZE_Y)
|
|
||||||
self.scrollRect:setPerLineNum(CELL_NUM)
|
|
||||||
self.scrollRect:refillCells(#self.params.rewards)
|
|
||||||
self.titleTx:setAnchoredPositionY(MAX_TITLE_POS_Y)
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user