侧边栏
This commit is contained in:
parent
7fccb1c162
commit
03d2625a0c
@ -132,9 +132,6 @@ function SideBarBaseCellComp:setAnchoredPositionY(y)
|
||||
end
|
||||
|
||||
function SideBarBaseCellComp:setVisible(visible)
|
||||
if self.visible == visible then
|
||||
return
|
||||
end
|
||||
self.visible = visible
|
||||
self.baseObject:setVisible(visible)
|
||||
if not visible then
|
||||
|
||||
@ -443,21 +443,21 @@ function MainCityUI:refreshLeftBtns()
|
||||
if isClose then -- 只显示一个
|
||||
local first = self.leftBarList[1]
|
||||
first:setAnchoredPositionY(y)
|
||||
first:setVisible(true)
|
||||
first:setActive(true)
|
||||
first:refresh()
|
||||
first:setActive(true)
|
||||
first:setVisible(true)
|
||||
y = y - self.sideBarHeight - SIDE_BAR_INTERVAL
|
||||
for i = 2, #self.leftBarList do
|
||||
self.leftBarList[i]:setVisible(false)
|
||||
self.leftBarList[i]:setActive(true)
|
||||
self.leftBarList[i]:refresh()
|
||||
self.leftBarList[i]:setActive(true)
|
||||
self.leftBarList[i]:setVisible(false)
|
||||
end
|
||||
else
|
||||
for k, v in ipairs(self.leftBarList) do
|
||||
v:setAnchoredPositionY(y)
|
||||
v:setVisible(true)
|
||||
v:setActive(true)
|
||||
v:refresh()
|
||||
v:setActive(true)
|
||||
v:setVisible(true)
|
||||
y = y - self.sideBarHeight - SIDE_BAR_INTERVAL
|
||||
end
|
||||
end
|
||||
@ -510,21 +510,21 @@ function MainCityUI:refreshRightBtns()
|
||||
if isClose then -- 只显示一个
|
||||
local first = self.rightBarList[1]
|
||||
first:setAnchoredPositionY(y)
|
||||
first:setVisible(true)
|
||||
first:setActive(true)
|
||||
first:refresh()
|
||||
first:setActive(true)
|
||||
first:setVisible(true)
|
||||
y = y - self.sideBarHeight - SIDE_BAR_INTERVAL
|
||||
for i = 2, #self.rightBarList do
|
||||
self.rightBarList[i]:setVisible(false)
|
||||
self.rightBarList[i]:setActive(true)
|
||||
self.rightBarList[i]:refresh()
|
||||
self.rightBarList[i]:setActive(true)
|
||||
self.rightBarList[i]:setVisible(false)
|
||||
end
|
||||
else
|
||||
for k, v in ipairs(self.rightBarList) do
|
||||
v:setAnchoredPositionY(y)
|
||||
v:setVisible(true)
|
||||
v:setActive(true)
|
||||
v:refresh()
|
||||
v:setActive(true)
|
||||
v:setVisible(true)
|
||||
y = y - self.sideBarHeight - SIDE_BAR_INTERVAL
|
||||
end
|
||||
end
|
||||
@ -539,8 +539,8 @@ function MainCityUI:clearSideBarList(sideBarList)
|
||||
local count = #sideBarList
|
||||
for i = 1, count do
|
||||
local cell = table.remove(sideBarList)
|
||||
cell:setVisible(false)
|
||||
cell:setActive(false)
|
||||
cell:setVisible(false)
|
||||
self.sideBarCellMap[cell:getCellPath()] = cell
|
||||
end
|
||||
end
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user