Aligning right to left on UICollectionView
Without doing any Xtransform to the collection view, simply forced RTL: YourCollectionView.semanticContentAttribute = UISemanticContentAttribute.forceRightToLeft
Without doing any Xtransform to the collection view, simply forced RTL: YourCollectionView.semanticContentAttribute = UISemanticContentAttribute.forceRightToLeft
Try this: self.collectionView.alwaysBounceVertical = YES; Complete code for a UIRefreshControl UIRefreshControl *refreshControl = [[UIRefreshControl alloc] init]; refreshControl.tintColor = [UIColor grayColor]; [refreshControl addTarget:self action:@selector(refershControlAction) forControlEvents:UIControlEventValueChanged]; [self.collectionView addSubview:refreshControl]; self.collectionView.alwaysBounceVertical = YES;
The problem appears to be with hitTest/pointInside. I’m guessing the cell is returning NO from pointInside if the touch is on the part of the button that is outside the cell and thus the button doesn’t get hit tested. To fix this you have to override pointInside on your UICollectionViewCell subclass to take the button … Read more
If you use your own subclass of UICollectionViewLayout, you can implement the methods: initialLayoutAttributesForAppearingItemAtIndexPath: for insertions finalLayoutAttributesForDisappearingItemAtIndexPath: for deletions According to the documentation, the attributes you return are used as starting points for the animation, and the end point are the normal attributes returned by your layout (or the opposite for deletion). Layout attributes include … Read more
– (void)reloadItemsAtIndexPaths:(NSArray *)indexPaths Here it is a method to reload the specific indexPaths in your collectionView
I have the same problem. And my solution is to change the Estimate size to None in the Xcode 11.
I run in the same problem. Code runs under 6.1 and crashes under 7.0 I solved the issue the following way: In the function -(NSInteger) numberOfSectionsInCollectionView:(UICollectionView *)collectionView I call [myCollectionView.collectionViewLayout invalidateLayout]; That´s all.
Only UICollectionView inside StoryBoard have UICollectionViewCell inside. If use XIB, create a new XIB with CellName.xib, add CollectionViewCell to it, specify name of UICollectionView custom class. After that use registerNib. Sample code: https://github.com/lequysang/TestCollectionViewWithXIB
This happened to me when number of cells in collectionView changed. Turns out I was missing invalidateLayout after calling reloadData. After adding it, I haven’t experienced any more crashes. Apple has made some modifications to collectionViews in iOS10. I guess that’s the reason why we are not experiencing same problem on older versions. Here’s my … Read more
Have you tried setting the scroll direction of your UICollectionViewFlowLayout to horizontal? [yourFlowLayout setScrollDirection:UICollectionViewScrollDirectionHorizontal]; And if you want it to page like springboard does, you’ll need to enable paging on your collection view like so: [yourCollectionView setPagingEnabled:YES];