[]list 数据不会及时渲染
refreshCard(0,[xxxxxx]);
public function refreshCard(index:int,cardArr:Array):void{
var cardList:List = _homeSeceneView["myCard_"+index];
if(cardList){
if(!cardList.visible){
cardList.visible = true;
}
cardList.renderHandler = new Handler(this, renderHandler, [cardList]);
// popArr = cardArr.pop();
if(index%2){
cardList.itemRender = roleCardUI;
cardList.repeatY = cardArr.length;
if(index == 1){
// cardList.y = 84;
}else{
// cardList.y = 84;
}
}else{
if(index == 0) {
cardList.mouseEnabled = true;
cardList.mouseHandler = new Handler(this, onSelect, [cardList]);
// 只能用new Handler? 不能用 Handler.create
// Handler.create(this, onSelect, [cardList]);
}
cardList.itemRender = MyCardUI;
cardList.repeatX = cardArr.length;
if(!index){
// cardList.x = 0;
}else{
// cardList.x = 0;
}
}
sortOnCard(cardArr);
cardList.array = cardArr;
}
}
private function onSelect(cardList:List, evt:Event, index:int):void
{
var cell:Box = cardList.getCell(index);
if(cell){
if(evt.type == Event.CLICK){
// refreshCard(0,MyHomeModel.intance.tempArr1);
// cardList.refresh();
// cardList.callLater(refreshCard[0,MyHomeModel.intance.tempArr1]);
cardList.array = MyHomeModel.intance.tempArr1; 点击数组换了 但原来的数据视图还在 重叠了 没有及时刷新 点击第二次才刷新好
}
}
}
}
}
public function refreshCard(index:int,cardArr:Array):void{
var cardList:List = _homeSeceneView["myCard_"+index];
if(cardList){
if(!cardList.visible){
cardList.visible = true;
}
cardList.renderHandler = new Handler(this, renderHandler, [cardList]);
// popArr = cardArr.pop();
if(index%2){
cardList.itemRender = roleCardUI;
cardList.repeatY = cardArr.length;
if(index == 1){
// cardList.y = 84;
}else{
// cardList.y = 84;
}
}else{
if(index == 0) {
cardList.mouseEnabled = true;
cardList.mouseHandler = new Handler(this, onSelect, [cardList]);
// 只能用new Handler? 不能用 Handler.create
// Handler.create(this, onSelect, [cardList]);
}
cardList.itemRender = MyCardUI;
cardList.repeatX = cardArr.length;
if(!index){
// cardList.x = 0;
}else{
// cardList.x = 0;
}
}
sortOnCard(cardArr);
cardList.array = cardArr;
}
}
private function onSelect(cardList:List, evt:Event, index:int):void
{
var cell:Box = cardList.getCell(index);
if(cell){
if(evt.type == Event.CLICK){
// refreshCard(0,MyHomeModel.intance.tempArr1);
// cardList.refresh();
// cardList.callLater(refreshCard[0,MyHomeModel.intance.tempArr1]);
cardList.array = MyHomeModel.intance.tempArr1; 点击数组换了 但原来的数据视图还在 重叠了 没有及时刷新 点击第二次才刷新好
}
}
}
}
}
没有找到相关结果
已邀请:
要回复问题请先登录
1 个回复
cuixueying
赞同来自: