uicollectionviewcell

How to nest a UICollectionViewCell inside another one?

这一生的挚爱 提交于 2019-12-13 03:44:00
问题 Following my old question here: How to add UIView inside a UITableViewCell Programmatically? I wanna achieve an enhanced view like that of iOS 11 Today tab with adding more elements in those collectionViewCell cards. I want to add biDirectional Scrolling like that of Netflix or other AppStore tabs (Games & Apps) inside my CollectionViewCell card(App Store Today tab cells). Here is an overview of what I want: Please tell is it possible to achieve such thing. If yes then how? Thanks. 回答1:

UICollectionView Cell with Image, change Background with click in Swift

女生的网名这么多〃 提交于 2019-12-13 03:37:30
问题 I have a Collection View that looks like this: The blue border is an image. When I press them I want the text and the image to dim briefly. I found this SO question that is similar: UICollectionView Cell with Image, change Background with click And it included this answer in Objective-C: If you have a CustomCell, you must have a CustomCell.m (implementation file). In this file add this, to me is the easy way: -(void)setHighlighted:(BOOL)highlighted { if (highlighted) { self.layer.opacity = 0

UICollectionView inside CustomTableCell

耗尽温柔 提交于 2019-12-13 03:35:10
问题 I have some problem when trying to implement UICollectionView with custom cell inside custom cell in tableView. I have custom table view cell which works fine, showing my label as I want. - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath*)indexPath { TemperatureTableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"Cell" forIndexPath: indexPath]; Node *node = [[Node alloc] init]; if(_nodes != nil){ node = [_nodes objectAtIndex:indexPath

IOS Swift CollectionView How can I set the correct background color on index

青春壹個敷衍的年華 提交于 2019-12-13 03:23:00
问题 This is my first time working with a CollectionView . I have a simple button which is repeated 9 times since I am populating it with a string array . I want to change the background color of the first element and I can do that however on Scroll I get other elements with that same background color too and I only want the first element to have that background color . This is my code class HomeC: UIViewController,CollectionViewDelegate,UICollectionViewDataSource { @IBOutlet weak var

Strange behaviour on adding constraints based upon condition

限于喜欢 提交于 2019-12-13 03:19:46
问题 I am making a view for conversation between two people. I have used UICollectionView with custom cell and using a flag based upon which I decide whether the message should be aligned towards left or right. The constraints work correctly if I use only a single direction of alignment, it even works correctly with condition based alignment unless number of messages in UICollectionView is less than four. So I know that constraints are not wrong. But as soon as I add the fourth message the

NSArray has objects yet UICollectionView is appearing empty

元气小坏坏 提交于 2019-12-13 02:49:30
问题 I've been working on this project to expand my portfolio. I am still rather new to objective-c, so help would be highly appreciated! I have been tinkering with this code for a few days now. I am aware the labels work, as I was able to get all the cells to display the same information (not the desired result). This was likely to a fault where my array didn't store all the objects. Below is the code for my UIViewController; INITIAL PROBLEM So I have confirmed that the NSLog, displays 8 objects

Get the sum of all collectionViewCells' heights inside a CollectionView

泄露秘密 提交于 2019-12-13 02:45:20
问题 I have a CollectionView created inside CollectionView cell class. The thing is I can't get the CollectionView that lives inside the first collectionView get the perfect size to fit all cells' sizes if any. First level comments Line is the First CollectionView Cell, enclosing the second level comments(contentView is blue and the collectionView holding the cells is red) I am using constraints to set the second collectionView height. It's basically fixed now. I know how to make the comments

Messing UIButton in each UICollectionViewCell in Scrolling Filmstrip

本小妞迷上赌 提交于 2019-12-13 02:35:40
问题 This is a follow-up question to my previous one and this time I have a problem with UIButton that I have added in each UICollectionViewCell. Before diving into the problem, let me brief out all I've got so far. Here's the basic rundown of how my UICollectionView in Scrolling Filmstrip style within UITableView works: Create a normal UITableView with a custom UITableViewCell Create a custom UIView that will be added to the cell's contentView The custom UIView will contain a UICollectionView The

UICollectionView jumpy scrolling

徘徊边缘 提交于 2019-12-13 02:33:29
问题 I am trying to create an interface that can hold "views" of different sizes etc. For this I am using a UICollectionView with these cells: -(UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath { Card *card = [[[usermanager getSelectedUser] getCards] objectAtIndex:indexPath.item]; UICollectionViewCell *cell=[collectionView dequeueReusableCellWithReuseIdentifier:@"cardCell" forIndexPath:indexPath]; [cell addSubview:card]; [cell

Application crash when set header of UICollectionView horizontally

天涯浪子 提交于 2019-12-13 02:15:44
问题 I am pretty new in UICollectionView. And I am really tired to find out the solution. I am trying to add Header in 3 Horizontally Row. I am using Collection view flow layout. Here is my code which I implement: - (void)awakeFromNib { self.collectionView.backgroundColor = [UIColor colorWithRed:204.0/255.0 green:204.0/255.0 blue:204.0/255.0 alpha:1.0]; self.collectionView.backgroundColor = [UIColor clearColor]; self.collectionView.backgroundView = [[UIView alloc] initWithFrame:CGRectZero];