uicollectionview

iOS Accessibility for CollectionView in a TableViewCell

人盡茶涼 提交于 2020-01-01 10:45:54
问题 I'm currently working on the accessibility of our project, and here is UICollectionView that is put into a custom UITableViewCell. This CollectionView has tens of cells that are arranged in multiply rows rather than one row. It raises an issue that when you have voiceOver on and move the focus between the collectionViewCells by swiping left or right, the system thought you are swiping between tableViewCells, since collectionView is in the tableView, and the contentOffSet of the tableView will

iOS Accessibility for CollectionView in a TableViewCell

纵饮孤独 提交于 2020-01-01 10:42:48
问题 I'm currently working on the accessibility of our project, and here is UICollectionView that is put into a custom UITableViewCell. This CollectionView has tens of cells that are arranged in multiply rows rather than one row. It raises an issue that when you have voiceOver on and move the focus between the collectionViewCells by swiping left or right, the system thought you are swiping between tableViewCells, since collectionView is in the tableView, and the contentOffSet of the tableView will

iOS Accessibility for CollectionView in a TableViewCell

試著忘記壹切 提交于 2020-01-01 10:42:25
问题 I'm currently working on the accessibility of our project, and here is UICollectionView that is put into a custom UITableViewCell. This CollectionView has tens of cells that are arranged in multiply rows rather than one row. It raises an issue that when you have voiceOver on and move the focus between the collectionViewCells by swiping left or right, the system thought you are swiping between tableViewCells, since collectionView is in the tableView, and the contentOffSet of the tableView will

Presenting a UIPopoverController from UICollectionViewCell

半城伤御伤魂 提交于 2020-01-01 10:04:54
问题 I'm looking to present a UIPopoverController from a button on a UICollectionViewCell. So far, everything is created ok, but the popover isn't visible. Is there a special way of doing this? The code works if I display it from anything else other than a collection view cell. The following code is in the UICollectionViewCell subclass. if (_infoPopover == nil) { UIStoryboard *storyboard = [UIStoryboard storyboardWithName:@"MainStoryboard" bundle:nil]; GameInfoViewController *gameInfoVC =

Swift 4 UICollectionView detect end of scrolling

前提是你 提交于 2020-01-01 09:21:58
问题 I have an Horizontal UICollectionView on my app and I want to load more data when the user reaches the end (or nearly to the end) of UICollectionView while dragging on the left. I'm using Swift 4. I found some Swift 3 solutions but they do not work for me. My current code is: func collectionView(_ collectionView: UICollectionView, numberOfItemsInSection section: Int) -> Int { return self.videoViewModel.images.count } func collectionView(_ collectionView: UICollectionView, cellForItemAt

Why does using headerReferenceSize with self-sizing cells in a collection view cause a crash in iOS 8?

╄→гoц情女王★ 提交于 2020-01-01 08:02:09
问题 I managed to figure out the approach for self-sizing collection view cells under iOS 8. I want to do this as a part of a accessory view. I get a crash ... the interesting part of the stacktrace is as follows: ** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '*** -[__NSArrayM insertObject:atIndex:]: object cannot be nil' *** First throw call stack: ( 0 CoreFoundation __exceptionPreprocess + 165 1 libobjc.A.dylib objc_exception_throw + 45 2 CoreFoundation -[_

how to set dynamic height of a Collection View, the 'view' not the 'cells'?

爷,独闯天下 提交于 2020-01-01 07:32:20
问题 I have embedded a collection view in another view and disabled the collection view's scrolling ability, what i want to achieve is similar to Instagram's profile tab. However, I cannot figure out how should I set the height of the collection view in this case since the number of cells are dynamic. I tried searching different solutions but most results are on changing the cells dynamically but not the collection view height itself. Is there any default/standard solutions for that? 回答1: Set the

Setting a new collectionViewLayout for UICollectionView giving blank screen

烈酒焚心 提交于 2020-01-01 07:23:07
问题 I'm starting to experiment with custom UICollectionView layouts. I have a UICollectionView in my UIViewController that conforms to the UICollectionViewDataSource and UICollectionViewFlowLayout protocols. Each cell is just an image and a label. I have a button that does this: - (IBAction)switchLayout:(id)sender { PinchLayout *pinchLayout = [[PinchLayout alloc] init]; [self.collectionView setCollectionViewLayout:pinchLayout]; } The PinchLayout is copied straight from Apple's sample code. When

UICollectionView - Horizontal AutoScroll with Timer

五迷三道 提交于 2020-01-01 07:22:44
问题 I am using Horizontal Auto Scroll using timer. I want it to scroll one by one. In my case it is scrolling continuos from left to right. and in last it also scroll white space after last cell. @interface AccountsVC ()<UICollectionViewDataSource, UICollectionViewDelegate,UICollectionViewDelegateFlowLayout> { CGFloat width_Cell; NSTimer *autoScrollTimer; } - (void)viewDidLoad { [super viewDidLoad]; width_Cell = 0.0; } - (void)viewDidAppear:(BOOL)animated { [super viewDidAppear:animated]; [self

collectionViewContentSize() vs contentSize

折月煮酒 提交于 2020-01-01 06:26:14
问题 What is the difference between collectionViewController.collectionViewLayout.collectionViewContentSize() and collectionViewController.collectionView.contentSize ? What do you prefer to use? 回答1: collectionViewContentSize() is a method you can override (in the layout) to generate the size dynamically. contentSize is a property of collectionView that is going to be used if there is no such override. It is similar to a UITableView 's rowHeight vs. the UITableViewDelegate 's