优化提交
This commit is contained in:
@@ -46,6 +46,27 @@ static NSInteger maxCount = 5;
|
||||
}
|
||||
self.cycleScrollView.imageURLStringsGroup = self.titles;
|
||||
}
|
||||
-(void)setList:(NSArray<QXGiftScrollModel *> *)list{
|
||||
_list = list;
|
||||
if (list.count >= 5) {
|
||||
[self.dataArray removeAllObjects];
|
||||
[self.titles removeAllObjects];
|
||||
for (int i = 0; i < 5; i++) {
|
||||
QXGiftScrollModel*md = list[i];
|
||||
[self.dataArray addObject:md];
|
||||
[self.titles addObject:md.fromUserName];
|
||||
}
|
||||
}else{
|
||||
for (QXGiftScrollModel*md in list) {
|
||||
[self.dataArray removeLastObject];
|
||||
[self.titles removeLastObject];
|
||||
[self.dataArray insertObject:md atIndex:0];
|
||||
[self.titles insertObject:md.fromUserName atIndex:0];
|
||||
|
||||
}
|
||||
}
|
||||
self.cycleScrollView.imageURLStringsGroup = self.titles;
|
||||
}
|
||||
- (Class)customCollectionViewCellClassForCycleScrollView:(SDCycleScrollView *)view{
|
||||
return [QXGiftScrollViewCell class];
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user