uicollectionview

uicollectionview select an item immediately after reloaddata?

余生颓废 提交于 2020-01-22 13:34:33
问题 After calling -[UICollectionView reloadData] it takes some time for cells to be displayed, so selecting an item immediately after calling reloadData does not work. Is there a way to select an item immediately after reloadData ? 回答1: Along the lines of this answer I found that calling layoutIfNeeded after reloadData seemed to effectively 'flush' the reload before I do other things to the collectionView: [self.collectionView reloadData]; [self.collectionView layoutIfNeeded]; ... On the page I

UICollectionViewFlowLayout doesn't use integral frames

独自空忆成欢 提交于 2020-01-22 10:07:07
问题 I have recently started using UICollectionView, and am a bit confused about the UICollectionViewFlowLayout. It would seem that the frames for each cell in the collection view are calculated with equal space between each item. This causes the frames of some of the cells to have fractional positions, which will cause blurry labels and misaligned image pixels and so on. I am surprised to find that there are no questions about this on stack overflow though, which makes me think I am doing

UICollectionViewFlowLayout doesn't use integral frames

回眸只為那壹抹淺笑 提交于 2020-01-22 10:06:32
问题 I have recently started using UICollectionView, and am a bit confused about the UICollectionViewFlowLayout. It would seem that the frames for each cell in the collection view are calculated with equal space between each item. This causes the frames of some of the cells to have fractional positions, which will cause blurry labels and misaligned image pixels and so on. I am surprised to find that there are no questions about this on stack overflow though, which makes me think I am doing

Animate UICollectionView cell size change and reposition surrounding cells

前提是你 提交于 2020-01-22 05:46:20
问题 Goal: To animate the change of a cell's height and reposition surrounding cells. Scenario: Some cells in a collection view load remote images. Initially, those cells are sized statically and an activity indicator is shown. After an image is loaded, it is added to its cell and the cell's height is changed to fit the photo. Notes: I am animating the cell's frame change with animateWithDuration . This works fine, except an increased cell size has it overlapping the cells below. I've blindly

How to expand collectionview cell to full screen [closed]

本秂侑毒 提交于 2020-01-21 07:48:45
问题 Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 3 years ago . I created a horizontal collection view and single cell is displayed in screen. I try to preview another views in each cell and when user swipe up the cell should expand to full screen. I don't know to how to approach this problem? How can I expand cell to fullscreen animated? 回答1: If you want to increase cell

Invalid update: invalid number of items in section 0.

旧街凉风 提交于 2020-01-20 05:22:45
问题 Recently I got the following error: Fatal Exception: NSInternalInconsistencyException Invalid update: invalid number of items in section 0. The number of items contained in an existing section after the update (13) must be equal to the number of items contained in that section before the update (12), plus or minus the number of items inserted or deleted from that section (0 inserted, 0 deleted) and plus or minus the number of items moved into or out of that section (0 moved in, 0 moved out).

UICollectionview footer in swift

限于喜欢 提交于 2020-01-17 04:58:10
问题 I want to add footer to a UICollectionView using this code. i am using Using Custom Layout in UICollectionView layout Added delegate and datasource methods :- UICollectionViewDelegate,UICollectionViewDataSource,UICollectionViewDelegateFlowLayout Code in viewdDidLoad() function :- UINib(nibName: "ProfileFooter", bundle:nil) collectionView!.registerNib(nibName1, forSupplementaryViewOfKind: UICollectionElementKindSectionFooter, withReuseIdentifier: "ProfileFooter") collectionView.registerClass

crash while scrolling through the TableView which haves a Collectionview in it

隐身守侯 提交于 2020-01-17 01:22:07
问题 i was having this issue (UICollectionView inside of UITableViewCell - AutoLayout) and after trying several solution which are available in the internet i came with this @Pablo Romeu's answer i tried his solution , now i got a TableView with collectionView cells in it (which can dynamically change its size according to content in it) but when am scrolling through my tableview its getting crashed with this error : 2016-06-13 22:05:51.546 WishMeluck[3507:425240] the behavior of the

Is it possible to add a drag to reload horizontally for a collection view?

这一生的挚爱 提交于 2020-01-16 19:33:12
问题 Update: I belive it may not be possible given the folowing line in apples documentation: When the user drags the top of the scrollable content area downward Found here. Let me know if there is a way to do this. I am trying to make it so that when the user swipe left (the way you swipe up in many apps with tableViews to reload) in a collection view it will show a loading icon and reload data (the reload data part I can handle myself). How can I detect this so I can call a reloadData() method?

Is it possible to add a drag to reload horizontally for a collection view?

风格不统一 提交于 2020-01-16 19:33:01
问题 Update: I belive it may not be possible given the folowing line in apples documentation: When the user drags the top of the scrollable content area downward Found here. Let me know if there is a way to do this. I am trying to make it so that when the user swipe left (the way you swipe up in many apps with tableViews to reload) in a collection view it will show a loading icon and reload data (the reload data part I can handle myself). How can I detect this so I can call a reloadData() method?