uicollectionview

UICollectionView isn't scrolling to indexPath

随声附和 提交于 2019-12-25 03:12:18
问题 I have a UICollectionView that I set the translatesAutoresizingMaskIntoConstraints to NO , and added some constraints . When I try scrolling it to an indexPath : [self.datesCollectionView selectItemAtIndexPath:selectedCellIndexPath animated:YES scrollPosition:UICollectionViewScrollPositionCenteredHorizontally]; Then it completely ignores that, and doesn't scroll. But when I remove translatesAutoresizingMaskIntoConstraints , then it scrolls, but the constraints are ignored. My question is, How

UICollectionView Layout customization

怎甘沉沦 提交于 2019-12-25 03:08:45
问题 I have a lot of section and items. When I touch button in cell it create cell with 4 items in 1 cell (like expanded table) touch again cell disappear. I found WaterfallCollectionView and there I can change height of items. What is the best way to achieve this??? Structure like: ----- ----- | +| | +| and other rows | | | | ----- ----- When I touch my button (+) it should be like: ----- ----- ----- | -| |__|__| | +| | | | | | | | ----- ----- ----- A new cell create with 4 UIImageView's inside 1

Performance - UICollectionView Loading time very slow

狂风中的少年 提交于 2019-12-25 02:48:10
问题 I am writing an app that takes a picture using the iDevice camera and stores it on the file system as a PNG. When starting my app, I load a UICollectionView with the images found on the file system. The issue I am facing is that the load time for the app (even when its only loading 6 images is approximately 4 seconds which is unacceptable. I have implemented GCD to load images on a background thread (which keeps the UI snappy) however I really want the app to start far quicker with images

why my stepper value inside collection view cell doesn't change?

半城伤御伤魂 提交于 2019-12-25 02:45:20
问题 I have collection view cell, and I have stepper and product name label inside the collection view cell. I have six products displayed on the collection view cell. I want to add the product to cart / order by tapping the Add To Cart Button. once the add to cart button is tapped, then the add to cart button will be hided and it will show the stepper, like the image below. here is my code for my collection view cell: protocol OrderCellDelegate { func stepperValueChange(at selectedIndexPath:

Dynamically handle the background and foreground colors inside UICollectionViewCell's elements

孤人 提交于 2019-12-25 02:33:44
问题 I have a UICollectionViewCell which contains a UIView enclosing a UILabel . I have to change the background color of UIView and the text color of UILabel on the base of a boolean value. The colors on the base of the boolean value work find unless I add the fourth item in the UICollectionView . All items from all previous and current cells get the same respective color like that of the items of the fourth cell as soon as I add the fourth item. The problem is exactly related to this but here I

UICollectionView crashes when deleting section

本秂侑毒 提交于 2019-12-25 01:54:14
问题 When using this code - (void)actionSheet:(UIActionSheet *)actionSheet clickedButtonAtIndex:(NSInteger)buttonIndex { if (buttonIndex == 0) { [self removeCompany:companySelectedInActionSheet]; NSIndexSet *indexSet = [NSIndexSet indexSetWithIndex: indexPathSelectedInActionSheet.section]; NSLog(@"IndexSet to delete from collection view: %@",indexSet); [self.collectionView deleteSections:indexSet]; } } my app crashes sometimes (10% of the time) with this error: *** Assertion failure in -

How to access text views in custom collection view cell class from the main class

蹲街弑〆低调 提交于 2019-12-25 01:49:22
问题 I've got two text views in each of my collection view cells, I've made a custom class for the cells. here is the code: class CustomWriterPageCell: UICollectionViewCell { fileprivate let textViewOne: UITextView = { let tv = UITextView() tv.backgroundColor = .cyan tv.text = "Chapter Title" tv.font = UIFont(name: "Avenir-Roman", size: 27) tv.textColor = .gray return tv }() fileprivate let textViewTwo: UITextView = { let tv = UITextView() tv.textColor = .gray tv.text = "Start your story..." tv

ARKit -[UIView setAnimationsEnabled:] Performing any operation from a background thread on UIView or a subclass is not supported

风格不统一 提交于 2019-12-25 01:46:53
问题 I have a ViewController that has a collectionView inside of it. I display the contents of the collectionView's cells inside an ARSCNView. When I set the ViewController's view property to the Material's content property I get the error from the question. material.diffuse.contents = self.myViewController.view // produces error and sometimes it crashes. When it does't crash I can see the collectionView fine but the error is still there I know it's the vc's view property that is causing the

Aligning right to left on UICollectionView with contents

空扰寡人 提交于 2019-12-25 01:39:16
问题 I tried with the following question: Aligning right to left on UICollectionView but it's not achieved my goal. What I was tried: In viewDidLoad() : collectionView.transform = CGAffineTransform(scaleX: -1.0, y: 1.0) In cellForItemAtIndexPath() : cell.transform = CGAffineTransform(scaleX: -1.0, y: 1.0) My current CollectionView is on the left, but I want it to look like the CollecitonView on the right. dataSource = ["item1","item2","item3","item4","item5","item6"] Update: Change

dequeueReusableSupplementaryViewOfKind crash on ios 7.1 - index 0 beyond bounds for empty array

自闭症网瘾萝莉.ら 提交于 2019-12-25 01:32:43
问题 having a collection view with 2 sections. section 1: rows: 0 section 2: rows: 20 having registerednibs like: [self.collectionView registerNib:[UINib nibWithNibName:@"MissionDetailHeader" bundle:nil] forSupplementaryViewOfKind:UICollectionElementKindSectionHeader withReuseIdentifier:@"MissionDetailHeader"]; [self.collectionView registerNib:[UINib nibWithNibName:@"MissionDetailHeaderPic" bundle:nil] forSupplementaryViewOfKind:UICollectionElementKindSectionHeader withReuseIdentifier:@