{"action":"closed","issue":{"url":"https://api.github.com/repos/Instagram/IGListKit/issues/497","repository_url":"https://api.github.com/repos/Instagram/IGListKit","labels_url":"https://api.github.com/repos/Instagram/IGListKit/issues/497/labels{/name}","comments_url":"https://api.github.com/repos/Instagram/IGListKit/issues/497/comments","events_url":"https://api.github.com/repos/Instagram/IGListKit/issues/497/events","html_url":"https://github.com/Instagram/IGListKit/issues/497","id":208714048,"number":497,"title":"How to make dynamic height and fix width equal to collection view frame width","user":{"login":"alexwillrock","id":6507402,"avatar_url":"https://avatars.githubusercontent.com/u/6507402?v=3","gravatar_id":"","url":"https://api.github.com/users/alexwillrock","html_url":"https://github.com/alexwillrock","followers_url":"https://api.github.com/users/alexwillrock/followers","following_url":"https://api.github.com/users/alexwillrock/following{/other_user}","gists_url":"https://api.github.com/users/alexwillrock/gists{/gist_id}","starred_url":"https://api.github.com/users/alexwillrock/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alexwillrock/subscriptions","organizations_url":"https://api.github.com/users/alexwillrock/orgs","repos_url":"https://api.github.com/users/alexwillrock/repos","events_url":"https://api.github.com/users/alexwillrock/events{/privacy}","received_events_url":"https://api.github.com/users/alexwillrock/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2017-02-19T12:22:49Z","updated_at":"2017-02-20T05:17:04Z","closed_at":"2017-02-20T05:17:04Z","body":"## New issue checklist\r\n\r\n- [ OK] I have reviewed the [`README`](https://github.com/Instagram/IGListKit/blob/master/README.md) and [documentation](http://instagram.github.io/IGListKit)\r\n- [ OK] I have searched [existing issues](https://github.com/Instagram/IGListKit/issues) and this is not a duplicate\r\n\r\n### General information\r\n\r\n- `IGListKit` version: 2.2.0\r\n- iOS version(s): 10+\r\n- CocoaPods/Carthage version: \r\n- Xcode version: 8+\r\n- Devices/Simulators affected: Simulators\r\n- Reproducible in the demo project? (Yes/No): NO\r\n- Related issues:\r\n\r\nhow to make dynamic height and fix width in cell ?\r\nin controller my code is:\r\n` UICollectionViewFlowLayout *layout = [[UICollectionViewFlowLayout alloc] init];\r\n    layout.estimatedItemSize = CGSizeMake(self.collectionView.frame.size.width, 137);\r\n    self.collectionView.collectionViewLayout = layout;`\r\n\r\nis section controller my code is:\r\n\r\n```\r\n- (CGSize)sizeForItemAtIndex:(NSInteger)index {\r\n\r\n    CGFloat width = self.collectionContext.containerSize.width;\r\n    CGFloat height = 137;\r\n\r\n    CGSize result = CGSizeMake(width, height);\r\n    return result;\r\n}\r\n```\r\n\r\nand in collection cell:\r\n\r\n```\r\n-(UICollectionViewLayoutAttributes *)preferredLayoutAttributesFittingAttributes:(UICollectionViewLayoutAttributes *)layoutAttributes{\r\n    \r\n    if (_isCalculate == false) {\r\n        \r\n       // [super preferredLayoutAttributesFittingAttributes:layoutAttributes];\r\n        \r\n        [self setNeedsLayout];\r\n        [self layoutIfNeeded];\r\n        \r\n        CGSize size = [self.contentView systemLayoutSizeFittingSize:layoutAttributes.size];\r\n        \r\n        CGRect newFrame = layoutAttributes.frame;\r\n        newFrame.size.width = (CGFloat)ceilf(size.width);\r\n        \r\n        NSLog(@\"%@\", newFrame);\r\n        \r\n        layoutAttributes.frame = newFrame;\r\n        _isCalculate = true;\r\n        \r\n        \r\n    }  \r\n    return layoutAttributes;\r\n}\r\n```\r\n\r\nAnd my cell is not fill width equal to collection view width, can you help me ?"}}
{"actor":{"display_login":"alexwillrock"}}