1. 每次只删那一个下标 removeItem
2.
forceDoLayoutfunction UIGuildScience:delSkillItem(_idx) --添加技能item
print("传进来的 点击的item idx " .. _idx)
local tbList = self.m_ListView_Science:getItems()
--dump(tbList, "tbList")
local isBeginDel = false
local tempDelTable = {} --记录下需要删除的项的对象
for k, v in ipairs(tbList) do
print("111*****************************************")
print("k = " .. k)
print("v.titleIdx " .. (v.titleIdx or "nil"))
print("222*****************************************")
if v.titleIdx and v.titleIdx > _idx then --结束
print("结束 idx " .. k)
isBeginDel = false
break
end
if isBeginDel == true then
print("要删的k " .. k)
table.insert(tempDelTable, tbList[k]) --把要删的对象存起来 然后遍历用removeChild删 用removeItem删会出错(索引会跳)
end
if v.titleIdx and v.titleIdx == _idx then --开始
print("