uicollectionviewcell

UICollectionView in a UICollectionViewCell

若如初见. 提交于 2019-12-20 18:09:10
问题 I am interested in having a collectionview as a part of a collection view cell but for some reason cannot figure out how this would be done. Where would I implement the necessary methods for the cells collectionview? 回答1: There's an article that Ash Furrow wrote that explains how to put an UICollectionView inside an UITableViewCell . It's basically the same idea when using it inside an UICollectionViewCell . 回答2: Everything is done programatically. No storyboards. I added a UICollectionView

UICollectionViewCell - contents do not animate alongside cell's contentView

血红的双手。 提交于 2019-12-20 09:03:06
问题 Problem looks like this: http://i.imgur.com/5iaAiGQ.mp4 (red is a color of cell.contentView) Here is the code: https://github.com/nezhyborets/UICollectionViewContentsAnimationProblem Current status: The content of UICollectionViewCell's contentView does not animate alongside contentView frame change. It gets the size immediately without animation. Other issues faced when doing the task: The contentView was not animating alongside cell's frame change either, until i did this in

Getting the screen location of a cell from a UICollectionView

 ̄綄美尐妖づ 提交于 2019-12-20 08:27:20
问题 This isn't so much a question as an explanation of how to solve this problem. The first thing to realize is that the UICollectionView does inherit from a UIScrollView - so doing a standard lookup with a scroll view's content is the best solution. Here's the problem I was addressing: I had a UICollectionView that had differing items in each cell - along with differing types of cells. I need the selection of a cell to cause an effect of the image in the cell to appear to expand and take over

Getting the screen location of a cell from a UICollectionView

限于喜欢 提交于 2019-12-20 08:27:02
问题 This isn't so much a question as an explanation of how to solve this problem. The first thing to realize is that the UICollectionView does inherit from a UIScrollView - so doing a standard lookup with a scroll view's content is the best solution. Here's the problem I was addressing: I had a UICollectionView that had differing items in each cell - along with differing types of cells. I need the selection of a cell to cause an effect of the image in the cell to appear to expand and take over

UICollectionViewCell one of the section from UICollectionView Cell Repeating same cell for multiple times

久未见 提交于 2019-12-20 07:02:25
问题 I have an old project done by a developer some times ago.. This particular project has 3 collection views such as collectionAnnouncments, collectionNews and collectionBulletin. The first collectionview collectionAnnouncments is loading a same cell 10 times. But other two sections loading the cell correctly one time as per the response count. I don't have any idea up to now for this problem. I tried some solutions from the google but I couldn't sorted because of the bad UI and Code

problem with images loading on top of already set images swift 4

痞子三分冷 提交于 2019-12-20 06:24:03
问题 I'm having an issue in my cellForItemAtIndexPath where I am setting an image to my cell's UIButton but every time I scroll the collectionView's cells, it's placing the image on top of the already set image again and again. I can tell because the shadow of the image is getting thicker and thicker. I'm pulling the images from an array that I created of image literals in that swift file and the correct images are loading so there's no problem there. I'm sure this is a simple fix for most but I

Landscape orientation for Collection View in Swift

橙三吉。 提交于 2019-12-20 06:11:17
问题 I am encountering a problem on landscape orientation for my collection view cell. When the app is in portrait it gives me the correct number of cell per row which is 2. But when I rotate my app to landscape it display 1 cell per row. Here's the screen of what I got: Portrait: Landscape: Here's my code for adding the size of the cell: func collectionView(collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, sizeForItemAtIndexPath indexPath: NSIndexPath) ->

View height constraints are not set correctly as I scroll UICollectionView up and down

懵懂的女人 提交于 2019-12-20 05:49:13
问题 I'm trying to decide view heights based on a model property, but as UICollectionView is scrolled up and down, incorrect heights are assigned to visible cells. It seems that setting a HeightAnchor in GetCell (i.e. cellForItemAtIndexPath ) does not work. How can I make this work? using CoreGraphics; using Foundation; using System; using System.Collections.Generic; using UIKit; namespace App2 { public partial class ViewController : UIViewController { private UICollectionView _collectionView;

UILabel with Tap Gesture Recognizer not working

筅森魡賤 提交于 2019-12-20 04:26:14
问题 I have designed a UICollectionViewCell using XIB and in that custom cell I have an UILabel whose user interaction I have enabled. In my viewcontroller when I am designing the cell , Here is my code. UITapGestureRecognizer *buyNowTapped = [[UITapGestureRecognizer alloc]initWithTarget:self action:@selector(buyNowClicked:)]; buyNowTapped.numberOfTapsRequired = 1.0; cell.buy.tag = indexPath.row; cell.buy.userInteractionEnabled = YES; [cell.buy addGestureRecognizer:buyNowTapped]; -(void

UICollectionView not loading fully until I scroll

感情迁移 提交于 2019-12-20 03:21:57
问题 I have a collection view that I want to display hourly weather in. I seem to have a problem with loading the cell, and for some reason scrolling forwards and then back loads the cell fully. Before I scroll the collection view, all of the constraints do not work and one label doesn't show it's info. Before scrolling After scrolling (this is how I want the cells to look like) func numberOfSectionsInCollectionView(collectionView: UICollectionView) -> Int { // #warning Incomplete implementation,