uicollectionviewcell

UICollectionView like iOS Home Screen [closed]

折月煮酒 提交于 2019-12-02 17:46:16
I wanna make an UICollectionView like iOS Home Screen. I found several (and good) samples like: http://mobile.tutsplus.com/tutorials/iphone/uicollectionview-layouts/ http://www.cocoacontrols.com/platforms/ios/controls/sespringboard http://www.cocoacontrols.com/platforms/ios/controls/aqgridview http://www.cocoacontrols.com/platforms/ios/controls/namenu http://www.cocoacontrols.com/platforms/ios/controls/mgbox2 iOS: Are there any open-source Launcher Views like the home screen? All libraries above work well. Editing, removing and animating is not a problem. But combining two cells into a new

Getting the screen location of a cell from a UICollectionView

天涯浪子 提交于 2019-12-02 15:24:40
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 the whole screen. How I did the expansion is for another post. The challenge was getting the cell's

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

拈花ヽ惹草 提交于 2019-12-02 12:32:06
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 implementation by that developer. Ex- He used one UICollectionView Inside a tableview and using UICollectionView

How to adjust UIView height according to the Collection View Content Height in swift 3?

混江龙づ霸主 提交于 2019-12-02 09:47:53
I have a problem of adjusting the UIView height in my project. I illustrated the project. Let me explain about my project image. Each Orange UIView has trailing, leading , top and bottom constraints and vertical spacing to each UIView. But, I add "Height" to each UIView because if I don't add, it gives error and add the "Height" warning. In UIView2, I add 3 Container Views. Each Container Views has 3 View Controllers. (Data 1 View, Data 2 View, Data 3 View) I embed Collection View inside in each views. The problem is that in Data 3 View has many collection View cell data. So, the height of

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

十年热恋 提交于 2019-12-02 09:34:34
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 can't seem to find an answer anywhere. Image of my cellForItemAtIndexPath function My app running before

Why won't my Collection View Cells display in the iPhone Simulator?

二次信任 提交于 2019-12-02 08:25:15
I am trying to programmatically create a Collection View with six cells. The iPhone Simulator in Xcode 8 told me that my build was successful. There is still an error though. Any help spotting the bug or bugs that are causing my cells not to display in the Simulator is greatly appreciated. (I put the Collection View directly into the IB from the Object Library. Also, I want each cell to occupy the entire size of the Collection View, hence displayedCellDimensions , because the user will segue between cells when a forward or backward button is tapped.) Thank you! import UIKit class

How to dynamically change the height of a UITableView Cell containing a UICollectionView cell in Swift?

有些话、适合烂在心里 提交于 2019-12-02 07:58:01
Currently, I have embedded a UICollectionViewCell in a UITableViewCell within one of the sections of my UITableView . I know how to dynamically change the cell's height in another section of my UITableView because I have a UITextView in another UITableViewCell that dynamically changes the height of the cell based on how much text is in the UITextView . The problem I have is in regards to the UITableViewCell containing the UICollectionViewCell . My UICollectionViewCell has one row of 4 images that the user can add via the camera or photo library using a UIImagePickerController . Currently as I

Decrease Space between UICollectionViewCells

放肆的年华 提交于 2019-12-02 07:47:59
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]; NSInteger maximumSpacing = 4; NSInteger origin = CGRectGetMaxX(prevLayoutAttributes.frame); if(origin +

UILabel with Tap Gesture Recognizer not working

淺唱寂寞╮ 提交于 2019-12-02 04:49:56
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)buyNowClicked : (id)sender { UIButton *button; UILabel *label; if([sender isKindOfClass:[UIButton class]]) {

How to create horizontally dynamic UICollectionView cells? Swift

三世轮回 提交于 2019-12-02 04:04:49
问题 Hey I'm trying display a set of "tags" in a view controller using collection view cells but I'm having trouble finding a way to make them be able to dynamically resizable depending on the length of the string. Right now the individual cells are statically sized so whenever a String that populates the cell with characters exceeding the size of the cell, it goes into the second line. I want it so that the cell can change length depending on the length of the String. So if it's the tag "#Vegan",