I am trying to create an interface that can hold "views" of different sizes etc. For this I am using a UICollectionView with these cells:
-(UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath {
Card *card = [[[usermanager getSelectedUser] getCards] objectAtIndex:indexPath.item];
UICollectionViewCell *cell=[collectionView dequeueReusableCellWithReuseIdentifier:@"cardCell" forIndexPath:indexPath];
[cell addSubview:card];
[cell.layer setBorderColor:[UIColor redColor].CGColor];
[cell.layer setBorderWidth:1.0f];
[cell.layer setMasksToBounds:NO];
return cell;
}
Everthing seems to work fine until the amount of cards becomes too big and I have to scroll. The view jumps a little bit when I lift my finger after scrolling. And I get some other weird UI issues. From what I have read this has to do with the reloading of the cells during scrolling. What would be the proper way to prevent that?
It is very important to note that the content is dynamic. The user should be able to add and remove cards at runtime.
Thanks