uicollectionview

Can I “take out” or “tear off” a cell from a UICollectionView?

£可爱£侵袭症+ 提交于 2019-12-22 00:22:30
问题 Note - it's possible UIViewControllerAnimatedTransitioning https://developer.apple.com/library/ios/documentation/uikit/reference/UIViewControllerAnimatedTransitioning_Protocol/Reference/Reference.html is relevant here. Note - I've just realised the new iOS7 "swipe-away" gesture is this concept there are some answers HERE: The UICollectionView "swipe-away" in iOS7 app manager? Imagine your iPad has a UICollectionView ("bigView"), vertical, which contains 10 cells, each about 400x400 say.

I have a UICollectionView and i want to show an image in a Cell, that goes to a normal ViewController. How do i do that?

馋奶兔 提交于 2019-12-21 23:12:12
问题 I have a UICollectionViewController (with a navigation controller) and i want to show an image in a Cell that 'pushes' to a normal ViewController (different by every image). How do i do that? 回答1: Seem you want to build photo gallery by UICollectionView. If use storyBoard, use segue - (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender { if ([[segue identifier] isEqualToString:@"showDetail"]) { NSIndexPath *selectedIndexPath = [[self.collectionView indexPathsForSelectedItems]

How can I dynamically resize a header view in a UICollectionView?

拈花ヽ惹草 提交于 2019-12-21 19:42:57
问题 I have header (a UICollectionReusableCell) in a UICollectionView whose height needs to be variable. How can I have it resize itself according to the height of its contents? I do not need to support iOS 7, and Autolayout solutions are preferable (if they exist). 回答1: This is how I solved it. I wish it was more elegant. Set the UILabel in the header view to have a numberOfLines value of 0. This will let it resize itself. Move the header out of the storyboard and into a xib. In collectionView(_

Center a UIView vertically and horizontally within its parent view

南笙酒味 提交于 2019-12-21 17:22:57
问题 I have a UICollection view that is inside another UIView. I am trying to center the collection view inside its parent view. Currently manually doing it by tweaking its frame (see code below). There has to be a easier way. CURRENT CODE: self.collectionView = [[UICollectionView alloc] initWithFrame:CGRectMake(COLLECTION_PADDING+10, COLLECTION_PADDING+5, self.bounds.size.width - (COLLECTION_PADDING*2), self.bounds.size.height - (COLLECTION_PADDING+22)) collectionViewLayout:flow]; 回答1: You could

XCode 6 UICollectionview viewwithtag not working

老子叫甜甜 提交于 2019-12-21 14:59:17
问题 Seems XCode 6 is different in using viewwithtags then XCode 5 was. I am using the following code in XCode 6 with Storyboards. 50 cells are created but the label is not visible.Everything is set correctly like the tag etc. If I use the "old" XCode 5 way to do it with Register cell classed it seems to work for iOS 7 but in iOS 8 the data is not passed to the label until I start to scroll. static NSString * const reuseIdentifier = @"MyCell"; - (void)viewDidLoad { [super viewDidLoad]; // Register

Error: UICollectionView received layout attributes for a cell with an index path that does not exist in Swift

独自空忆成欢 提交于 2019-12-21 13:14:07
问题 I "https://www.raywenderlich.com/392-uicollectionview-custom-layout-tutorial-pinterest" To create a Custom UICollectionView. (To adjust cell height) If I scroll up, the cell will continue to be added, and scroll from top to bottom to refresh. There is no problem when you run your app and initially grow Cells. However, there is always an error when refreshing or reordering the number of cells. ERROR : *** Assertion failure in -[UICollectionViewData validateLayoutInRect:], /BuildRoot/Library

Error: UICollectionView received layout attributes for a cell with an index path that does not exist in Swift

巧了我就是萌 提交于 2019-12-21 13:13:29
问题 I "https://www.raywenderlich.com/392-uicollectionview-custom-layout-tutorial-pinterest" To create a Custom UICollectionView. (To adjust cell height) If I scroll up, the cell will continue to be added, and scroll from top to bottom to refresh. There is no problem when you run your app and initially grow Cells. However, there is always an error when refreshing or reordering the number of cells. ERROR : *** Assertion failure in -[UICollectionViewData validateLayoutInRect:], /BuildRoot/Library

UICollectionView indexPathForItemAtPoint returning same item despite scrolling

不想你离开。 提交于 2019-12-21 09:26:19
问题 What is the correct syntax for using UICollectionView's indexPathForItemAtPoint? I'm using the following code to try to identify the cell that is at the centre of the UICollectionView as I scroll through it. - (void)scrollViewDidScroll:(UIScrollView *)scrollView { //locate the scrollview which is in the centre CGPoint centerPoint = CGPointMake(self.collectionView.frame.size.width / 2, self.collectionView.frame.size.height /2); NSIndexPath *indexPathOfCentralCell = [self.collectionView

iOS: Storyboard CollectionView segue not being triggered

◇◆丶佛笑我妖孽 提交于 2019-12-21 09:24:46
问题 I have a UICollectionView controller embedded inside a navigation controller. The collectionView lists projects and each cell is supposed to segue to a ProjectDetail screen. I simply cannot get the segue to trigger. If I simply drop a button on the nav bar and hook up a segue to the detail, it works. But triggering from my CollectionView cell doesn't. Here is what the storyboard looks like: http://cl.ly/RfcM I do have a segue hooked up from the CollectionViewCell to the

UICollectionView Cell Overlap

谁都会走 提交于 2019-12-21 09:12:24
问题 I have a horizontal UICollectionView. I want to make the cells overlap each other by a certain amount of 60 pixels so that the second cells overlaps the first by 60 pixels and the third overlaps the second by the same amount and so on. I tried sub classing UICollectionViewFlowLayout. But I am not able to place the UICollectionviewCell on top of one another. 回答1: Starting with this tutorial: https://web-beta.archive.org/web/20151116053251/http://blog.tobiaswiedenmann.com/post/35135290759