uicollectionview

Customising position of header in UICollectionView layout causes NSInternalInconsistencyException error

烂漫一生 提交于 2019-12-21 08:48:31
问题 I am trying to customise the positions of the headers in a UICollectionView using a subclassed UICollectionViewFlowLayout class (based loosely on the code for stacked headers which is shown enter link description here). As a minimal test, let's say I just want to add a fixed offset to the position of all headers: I add all headers to the array returned by layoutAttributesForElementsInRect so that all are always processed (this may be the cause of the problem, I'm not sure) I then update each

Customising position of header in UICollectionView layout causes NSInternalInconsistencyException error

空扰寡人 提交于 2019-12-21 08:46:07
问题 I am trying to customise the positions of the headers in a UICollectionView using a subclassed UICollectionViewFlowLayout class (based loosely on the code for stacked headers which is shown enter link description here). As a minimal test, let's say I just want to add a fixed offset to the position of all headers: I add all headers to the array returned by layoutAttributesForElementsInRect so that all are always processed (this may be the cause of the problem, I'm not sure) I then update each

Variable width & height of UICollectionViewCell using AutoLayout with Storyboard (without XIB)

本秂侑毒 提交于 2019-12-21 07:31:42
问题 Here is an design issue in the app that uses AutoLayout, UICollectionView and UICollectionViewCell that has automatically resizable width & height depending on AutoLayout constraints and its content (some text). It is a UITableView list like, with each cell that has it's own width & height calculated separately for each row dependant on its content. It is more like iOS Messages build in app (or WhatsUp). It is obvious that app should make use of func collectionView(collectionView:

UICollectionView is scrolling when selecting a cell

被刻印的时光 ゝ 提交于 2019-12-21 07:07:01
问题 I'm having trouble when i try to select an item inside a UICollectionView since when I click on it it scrolls a little bit. I know didSelectItemAtIndexPath is being called but I want to prevent the scrolling when selecting. I only want the collection view to scroll when the user is scrolling through but if the user is just tapping the cell it shouldn't move. Only should be selected. I hope you can help me since I don't know how to prevent this problem. Any help will be really appreciated. 回答1

Autolayout is not resizing Uicollectionviewcell items when animating between layouts

旧巷老猫 提交于 2019-12-21 06:36:31
问题 I have a uicollectionview cell with an image view inside that I want to resize when I switch to a larger 'zoomed in' layout. I have placed constraints inside the cell that does resize the image view when the zoomed in layout is displayed. I am using uicollectionview setLayout animated method. The problem is the image does not scale with animation only the collection view cell does. The image seems to just jump into its end size with no interpolation. So the animation looks extremely choppy.

How to use UICollectionViewController in storyboard while still supporting ios 5.1?

笑着哭i 提交于 2019-12-21 06:28:37
问题 It is a best practice to detect if a certain feature's class exists and degrade user's features depending on availability. I created UICollectionView in storyboard and a standard tableview to support ios 5.1 users. I then simply check if the user has this feature and segue to the appropriate scene. However, when I now try to compile my code I get a "dyld: Symbol not found: _UICollectionElementKindSectionHeader" This seems very anti-pattern of apple to not allow ios6.0 features in storyboard

Expanding UICollectionView and its cell when tapped

拜拜、爱过 提交于 2019-12-21 06:28:26
问题 I am trying to make a transition animation like the demonstration in the link here. So when I clicked the cell, it expands and covers the whole screen. Here are my codes(I have to admit that I am not familiar with CollectionView)` import UIKit class ViewController: UIViewController, UICollectionViewDataSource, UICollectionViewDelegate { @IBOutlet weak var mainDesLabel: UILabel! @IBOutlet weak var collectionView: UICollectionView! @IBOutlet weak var secDesLabel: UILabel! let searchBar =

AVPlayerViewController in UICollectionViewCell bug?

旧街凉风 提交于 2019-12-21 06:28:19
问题 In my UICollectionView i have a cell. This is my cellForItemAtIndexPath func collectionView(collectionView: UICollectionView, cellForItemAtIndexPath indexPath: NSIndexPath) -> UICollectionViewCell { var videoCell = collectionView.dequeueReusableCellWithReuseIdentifier("cellVideo", forIndexPath: indexPath) as? CollectionViewCell let post = self.arrayOfDetails[indexPath.row] var myUrl = post.image // post.image is image url let fileUrl = NSURL(string: post.image) aPlayer = AVPlayer(URL: fileUrl

How to use useLayoutToLayoutNavigationTransitions in UICollectionView?

落花浮王杯 提交于 2019-12-21 06:26:18
问题 I was trying to learn the new layout transition effect in iOS7 collection view. However, I am unable to get it to work at all. I have attached a screen shot description below. I am aware that the same Collection View is used between Controllers when this Transition effect is in effect. But, why that collection view is not reloading when transition is happening. I even tried Reloading the collection view an that too failed. There should be some simple point I should be missing. Help me please.

Keep size of a custom cell in a UICollectionView when moving

邮差的信 提交于 2019-12-21 05:13:37
问题 I have a horizontal collection view and every cell has it's own width. I use the default UICollectionViewFlowLayout. When rearranging, cell inherits the width of the cell which it overlays during this movement, what I don't want. Any idea, how to avoid this behavior? 回答1: So, If you have the UICollectionView with cells of different sizes and you'd like to keep their sizes when moving using the standard UICollectionViewFlowLayout use this: extension UICollectionViewFlowLayout { @available(iOS