uicollectionviewcell

UICollectionView inside of UITableViewCell - AutoLayout

守給你的承諾、 提交于 2020-01-13 19:27:09
问题 I'm using a UICollectionView inside of a UITableViewCell . It's all working fine, but i have some issues with Auto Layout. The UICollectionView should just show the cells without horizontal or vertical scrolling.Because now I have a the scrollable UICollectionView inside my UITableViewCell the following code doesn't work for me to get the dynamic table cells' height for this cell, but for other cells. self.tableView.rowHeight = UITableViewAutomaticDimension self.tableView.estimatedRowHeight =

Tap Gesture not working as expected when added to uiview in collectionview cell

左心房为你撑大大i 提交于 2020-01-13 18:55:49
问题 I am adding a tap gesture recognizer programmatically to a custom collection view cell class. for some reason, it doesnt seem to be working. the frame is not 0, isUserInteractionEnabled is set to true and i made sure the tap view is on top of all other views: The custom cell class: let containerView: UIView = { let view = UIView() view.isUserInteractionEnabled = true view.translatesAutoresizingMaskIntoConstraints = false return view }() let tapView: UIView = { let v = UIView() v

How Can I Animate the Size of A UICollectionViewCell on Scroll so the middle one is largest?

自闭症网瘾萝莉.ら 提交于 2020-01-13 04:55:09
问题 I have a UICollectionView that shows several rows with one, full-width column (looks like a UITableView) What I'd like to achieve is something similar to this: ... where the middle cell has a much greater height. As the user scrolls up and down, the cells before and after the middle cell animate back to the default height for the given cell. Can somebody outline how I should approach this problem? 回答1: I use this Swift 3 code in my horizontal UICollectionView . func scrollViewDidScroll(_

Cell of UICollectionView not always refreshed after a scroll

一曲冷凌霜 提交于 2020-01-12 06:51:30
问题 I have defined in my Storyboard (iPad) a view that contains a UICollectionView , at the bottom of the view there's also a UIToolbar . In the UICollectionView I have added a UICollectionViewCell (implemented by an iPadCellCollectionViewCell class) that contains a another view that is a Core-Plot Graph (a CPTGraphHostingView class). I have a class called X that implements the UICollectionViewDelegate and UICollectionViewDataSource . In the class X, I build for each cell of my view (in

Subview frame is incorrect when creating UICollectionViewCell

坚强是说给别人听的谎言 提交于 2020-01-11 18:50:53
问题 The problem I created a UICollectionViewController with a custom UICollectionViewCell. The custom cell contains a large and rectangular UIView (named colorView) and a UILabel (named nameLabel). When the collection is first populated with its cells and I print colorView.frame, the printed frames have incorrect values. I know they are incorrect, because the colorView frames are larger than the cell frame themselves, even though the colorView gets drawn correctly. However, if I scroll the

Subview frame is incorrect when creating UICollectionViewCell

試著忘記壹切 提交于 2020-01-11 18:48:44
问题 The problem I created a UICollectionViewController with a custom UICollectionViewCell. The custom cell contains a large and rectangular UIView (named colorView) and a UILabel (named nameLabel). When the collection is first populated with its cells and I print colorView.frame, the printed frames have incorrect values. I know they are incorrect, because the colorView frames are larger than the cell frame themselves, even though the colorView gets drawn correctly. However, if I scroll the

Decrease Space between UICollectionViewCells

隐身守侯 提交于 2020-01-11 13:27:51
问题 Objective I am trying to decrease the space between my UICollectionViewCells What I tried I tried subclassing UICollectionViewFlowLayout and overriding this method: - (NSArray *) layoutAttributesForElementsInRect:(CGRect)rect { NSArray *answer = [[super layoutAttributesForElementsInRect:rect] mutableCopy]; for(int i = 1; i < [answer count]; ++i) { UICollectionViewLayoutAttributes *currentLayoutAttributes = answer[i]; UICollectionViewLayoutAttributes *prevLayoutAttributes = answer[i - 1];

Delete cell from UICollectionView without reloading from top [closed]

百般思念 提交于 2020-01-09 09:04:11
问题 It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center. Closed 6 years ago . I am using a CollectionView in my ios app. Each collection cell contains a delete button. By clicking the button the cell should be deleted. After deletion, that space will be filled with below cell (I don't wish

Delete cell from UICollectionView without reloading from top [closed]

 ̄綄美尐妖づ 提交于 2020-01-09 09:04:09
问题 It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center. Closed 6 years ago . I am using a CollectionView in my ios app. Each collection cell contains a delete button. By clicking the button the cell should be deleted. After deletion, that space will be filled with below cell (I don't wish

Delete cell from UICollectionView without reloading from top [closed]

↘锁芯ラ 提交于 2020-01-09 09:02:43
问题 It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center. Closed 6 years ago . I am using a CollectionView in my ios app. Each collection cell contains a delete button. By clicking the button the cell should be deleted. After deletion, that space will be filled with below cell (I don't wish