uicollectionviewcell

Duplicated Cell Animation During Batch Update

老子叫甜甜 提交于 2020-01-07 03:40:15
问题 I have set up a collectionView to have custom reordering behavior via the solution here However, when a cell is quickly dragged to a new row, the animation shows the dragged cell animate from its original position again (see below): I am wondering how I could have it just drop the dragged cell at the row it's been dragged to, rather than showing it animate from its original cell again. 回答1: I have solved this well by increasing the setting the dragged cell's layer.speed property when the

Swift, collection view & storyboard, get null when using viewWithTag on another Label

一笑奈何 提交于 2020-01-06 18:43:09
问题 I am seeing some extremely odd behavior that I would like some assistance with. I have a collection view cell that originally had one label, with a tag of 43. I am setting the value of the label using the following code: func collectionView(collectionView: UICollectionView!, cellForItemAtIndexPath indexPath: NSIndexPath!) -> UICollectionViewCell! { let object = self.fetchedResultsController.objectAtIndexPath(indexPath) as NSManagedObject let cell = collectionView

Swift: Action button inside a collectionviewcell

时光怂恿深爱的人放手 提交于 2020-01-06 17:58:48
问题 I have a button inside a collectionview cell that I programmatically created. @IBAction func editButtonTapped() -> Void { print("Hello Edit Button") } j func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell { let editButton = UIButton(frame: CGRect(x: 8, y: 241, width: 154, height: 37)) editButton.setImage(UIImage(named: "background-1 (dragged).tiff"), for: UIControlState.normal) editButton.addTarget(self, action: #selector

Swift: Action button inside a collectionviewcell

寵の児 提交于 2020-01-06 17:58:25
问题 I have a button inside a collectionview cell that I programmatically created. @IBAction func editButtonTapped() -> Void { print("Hello Edit Button") } j func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell { let editButton = UIButton(frame: CGRect(x: 8, y: 241, width: 154, height: 37)) editButton.setImage(UIImage(named: "background-1 (dragged).tiff"), for: UIControlState.normal) editButton.addTarget(self, action: #selector

How to Save Data and Segue Back to Collection View?

别来无恙 提交于 2020-01-06 16:17:50
问题 tl;dr: I'm having trouble figuring out how to segue from my NewTransactionViewController back to my main CollectionViewController and when going back, adding the data from the NewTransactionViewController into my collection list view. What I've found online is either too basic for what I need or too sophisticated. Essentially I'm trying to mimic a UITableView but I'm using collections for more dynamic capabilities later on (plus I want the option of multiple columns). I'm new to programming

How to Save Data and Segue Back to Collection View?

社会主义新天地 提交于 2020-01-06 16:17:26
问题 tl;dr: I'm having trouble figuring out how to segue from my NewTransactionViewController back to my main CollectionViewController and when going back, adding the data from the NewTransactionViewController into my collection list view. What I've found online is either too basic for what I need or too sophisticated. Essentially I'm trying to mimic a UITableView but I'm using collections for more dynamic capabilities later on (plus I want the option of multiple columns). I'm new to programming

How to Save Data and Segue Back to Collection View?

最后都变了- 提交于 2020-01-06 16:17:02
问题 tl;dr: I'm having trouble figuring out how to segue from my NewTransactionViewController back to my main CollectionViewController and when going back, adding the data from the NewTransactionViewController into my collection list view. What I've found online is either too basic for what I need or too sophisticated. Essentially I'm trying to mimic a UITableView but I'm using collections for more dynamic capabilities later on (plus I want the option of multiple columns). I'm new to programming

Pass touches on some part of UICollectionView to underlying views

心已入冬 提交于 2020-01-05 16:52:26
问题 First take a look at the attacthed image: My hiearchy looks as following: UIView UIButton UICollectionView UICollectionViewCell UICollectionViewCell UICollectionViewCell UICollectionViewCell UICollectionView is added to UIVew as H:[collectionView(==270)]| and V:|-(70)-[collectionView]-(70)-| . I have two requirements: 1) only the blue part of the UICollectionViewCell should trigger the collectionView::didSelectItemAtIndexPath: method. Which I have sucesfully implemented with - (UIView *

How to get the selected CollectionViewCell in the UICollectionView?

╄→гoц情女王★ 提交于 2020-01-05 12:14:33
问题 I am new for IOS development , and I try to use UIcollectionView to show the photo without using storyboard . I create a xib file call AITFileCell_grid.xib , and add a Collection View Cell . I also create another xib file and add the Collection View for loading Collection View Cell . I want to selected multiple file and delete them by delete button . But I can not get the cell when I click the delete button by following code. if(self.collectionView.indexPathsForSelectedItems > 0){ NSLog(@

UICollectionViewCell is square, but image is rectangle

回眸只為那壹抹淺笑 提交于 2020-01-05 08:58:28
问题 I am using UICollectionView where cell's are almost square, but original image is rectangle. Therefore, when I display image as follows, it is getting cut. Is there a way to handle this issue? I am currently working on Objective-C but I am to see Swift solution as well. cell.productImage content mode is Aspect Fill cell.productImage.image = [cell.productImage.image imageWithRenderingMode:UIImageRenderingModeAlwaysTemplate]; 回答1: Please add this line to your code. cell.productImage.contentMode