uicollectionviewcell

CollectionView nested inside Collectionview

*爱你&永不变心* 提交于 2019-12-12 23:12:23
问题 I have seen solutions where a collection view is nested inside a table view but for my app I need to have 2 collection views as it makes it easier to do some other things. So lets call the root collection view VerticalCollectionView which only scrolls vertically and the nested collection view HorizontalCollectionView which only scrolls horizontally. I created them using the Storyboard. Below you'll see the orange is the Vertical with the green Horizontal with a label inside it. And I have set

How to pass gestures from UITextView to UICollectionViewCell

坚强是说给别人听的谎言 提交于 2019-12-12 20:44:00
问题 I have a horizontal scrolling UICollectionView with UICollectionViewCells that contain a UITextView. Is there any way to pass gestures on the textview to the cells, so that didSelectItemAtIndexPath gets called?. I tried it with subclassing UITextView and passing touchesbegin/end to the cell, but that didn't worked. 回答1: You can make the view non-interactive, which will cause touches to get passed through: textView.userInteractionEnabled = NO; If you need it to be interactive, you can try this

Perform Segue from Collection View Cell

牧云@^-^@ 提交于 2019-12-12 16:50:54
问题 import UIKit class ActionCollectionViewCell: UICollectionViewCell { @IBOutlet weak var myLabel: UILabel! @IBOutlet weak var actionGIF: UIImageView! @IBAction func actionPressed(sender: AnyObject) { print(myLabel.text) Global.actionButtonIndex = myLabel.text!.toInt()! - 1 print(actionGIF.image) ActionViewController.performSegueWithIdentifier("showActionPreview", sender: nil) } } I am trying to perform a Segue after User Clicking on One of the Cell in my Collection View. Can't seem to do that

Reloading TableView from CollectionViewCell

心不动则不痛 提交于 2019-12-12 16:17:45
问题 Does anyone have idea how to reload TableView that's inside of CollectionViewCustomCell? I have an IBOutlet of that Table and the only way to access that Table is inside cellForItemAtIndexPath method where I can access my CollectionViewCustomCell and through that access the Table . cell.tableViewInsideOfCollectionViewCell.reloadData() But this only works on the first load, when I change CollectionView source it will not reload TableView . If you need anymore info, please ask! Thanks in

-[UIImage length]: unrecognized selector sent to instance error with a NSMutableArray with Images

扶醉桌前 提交于 2019-12-12 11:34:31
问题 I have a storyboard app which has a UIViewController and a UICollectionViewController . In the view controller, the user chooses multiple photos from the iPhone's photo library (Since there is no API for multi-select in iOS, I used ELCImagePickerController to achieve this). And it segues to the collection view controller where the selected photos should be shown in little image views. The image library shows up and I am able to select multiple photos. But when it segues to the collection view

ios - horizontally scrolling collectionView with images

倾然丶 夕夏残阳落幕 提交于 2019-12-12 10:20:49
问题 I am trying to show images on collectionView. I have trouble showing this images as I have created a reusable cell with imageView inside.Those images have to be equally spaced between as I want to show 3 icons on screen at once. I am using 13 icons and it has to be scrollable horizontally through screen. I am not able to show image in cell and I do not know how to set image cells with spacing between them using just one reusable cell CustomCollectionViewCell.h @interface

Dynamically resizing a UICollectionViewCell

北城余情 提交于 2019-12-12 10:16:21
问题 I have a UICollectionView with 2 UILabel and a UIImage with a similar layout: -------------------- | | | LABEL1 | | IMAGE | | LABEL2 | | ...... | | ...... | -------------------- Label2 has a variable number of lines, different between cells, and I would like to be able to autosize the UICollectionView height according to label2 height , to let it "autofill" the cell. Is it possible to do it in iOS? 回答1: You can override following method of UICollectionViewDelegateFlowLayout to dynamically

UICollectionView crashes randomly because of highlighting issue

扶醉桌前 提交于 2019-12-12 08:55:10
问题 I have a UICollectionView on iOS7 which crashes randomly when intense scrolling. I enabled zombies and found that it gives me an error saying: *** -[NSIndexPath section]: message sent to deallocated instance 0x17dbc970 I believe this is due to an Apple error described here. Apparently, the app crashes when someone highlights a cell while scrolling fast, and then the OS tries to unhighlight it when it moves off screen, when it ceases to exist. The proposed solution is to disable the

UICollectionView with variable cell sizes

半城伤御伤魂 提交于 2019-12-12 08:13:54
问题 I'm struggling a little bit with the size for cells in UICollectionView. In android, you can easily "wrap" the size of the cell. Just like in iOS, you have a function call 'GetCell' and you decide how big it will be. The difference in iOS is that in the "getCell" function (of UICollectionViewController) it seems you can't choose the size of the cell (or the contentview). If I change the size, it will ignore it and use anyway the general 'ItemSize' of the CollectionView (which is the same for

Dynamically change cell size according to image in a UICollectionView

本秂侑毒 提交于 2019-12-12 07:57:00
问题 I am displaying dynamic images recieved from server in a horizontal collection view. When I set up the collectionview I set this: -(void)setupCollectionView{ [self setupPageControlView]; self.screensCollectionView.delegate=self; self.screensCollectionView.dataSource=self; [self.screensCollectionView registerNib:[UINib nibWithNibName:@"FGAppScreensCollectionViewItemCell" bundle:nil] forCellWithReuseIdentifier:@"screenCell"]; UICollectionViewFlowLayout *flowLayout = [[UICollectionViewFlowLayout