uicollectionviewcell


Animate UICollectionView cell size change and reposition surrounding cells

前提是你 提交于 2020-01-22 05:46:20
问题 Goal: To animate the change of a cell's height and reposition surrounding cells. Scenario: Some cells in a collection view load remote images. Initially, those cells are sized statically and an activity indicator is shown. After an image is loaded, it is added to its cell and the cell's height is changed to fit the photo. Notes: I am animating the cell's frame change with animateWithDuration . This works fine, except an increased cell size has it overlapping the cells below. I've blindly

How to expand collectionview cell to full screen [closed]

本秂侑毒 提交于 2020-01-21 07:48:45
问题 Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 3 years ago . I created a horizontal collection view and single cell is displayed in screen. I try to preview another views in each cell and when user swipe up the cell should expand to full screen. I don't know to how to approach this problem? How can I expand cell to fullscreen animated? 回答1: If you want to increase cell

Selector to get indexPath UICollectionView Swift 3.0

青春壹個敷衍的年華 提交于 2020-01-20 08:41:29
问题 I'm trying to get indexPath on the cell when it is tapped twice. I'm passing arguments in Selector like this but it is giving error. What is the correct format for this ? func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell { if let subOptioncell : SubOptionsCollectionViewCell = collectionView.dequeueReusableCell(withReuseIdentifier: subOptionsCVReuseIdentifier, for: indexPath) as! SubOptionsCollectionViewCell let imageNamed = "\

Selector to get indexPath UICollectionView Swift 3.0

落爺英雄遲暮 提交于 2020-01-20 08:39:55
问题 I'm trying to get indexPath on the cell when it is tapped twice. I'm passing arguments in Selector like this but it is giving error. What is the correct format for this ? func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell { if let subOptioncell : SubOptionsCollectionViewCell = collectionView.dequeueReusableCell(withReuseIdentifier: subOptionsCVReuseIdentifier, for: indexPath) as! SubOptionsCollectionViewCell let imageNamed = "\

Why aren't my videos showing in cells in my scroll view with AVPlayer

↘锁芯ラ 提交于 2020-01-16 08:27:13
问题 I know my code isn't efficient as of yet, I just want it to work really before I optimise it. Basically I have a function FeaturedPostsManager.shared.getFeaturedPosts to get videos from my server and store it in the app's cache and store the local url to the video. Which in my code I do it twice for two different videos, so I have two urls that go to two different videos. I then add them urls in my custom data array for my scroll view to unwrap for each cell and add it's respective video to

UICollectionView Tap Selects More Than One Cell

蹲街弑〆低调 提交于 2020-01-14 15:01:29
问题 I have a strange problem when tapping a single UICell in UICollectionView and then scrolling down or up in the UICollectionView I see that more one cell is selected. The other cells that are selected that were not tapped seem to be randomly selected throughout the UICollectionView layout. I have 3 columns of cells and many rows in the UICollectionView. In my code I have the following: - (void)collectionView:(UICollectionView *)myCV didSelectItemAtIndexPath:(NSIndexPath *)indexPath { LogInfo(@

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

工具导航Map