草庐IT

UiCollectionView

全部标签

ios - 将文档目录中的图像异步加载到 UICollectionView

我正在尝试将文档目录中的图像加载到UICollectionView中。它的工作原理:流畅,快速....(笑)。但我遇到一个问题:当我调用[collectionViewreloadData]时,图像闪烁(一次)。这是我的代码:-(UICollectionViewCell*)collectionView:(UICollectionView*)collectionView_cellForItemAtIndexPath:(NSIndexPath*)indexPath{NSString*cellIdentifier=NSStringFromClass([AFMyRecentCollectionV

ios - UICollectionView ItemSelected 不触发

ThisisforXamarin.iOSSorryforconfusionthisisnotforObjective-CbutforC#Xamarin.iOS,IalreadyhadthetagsforXamarin.从2014年开始,整个互联网似乎都在说ItemSelected没有在UICollectionView上触发。除了使用TouchesBegan,TouchesEnded之外,还有其他解决方案吗?我还注意到CellDisplayingEnded()也没有触发!!Answeringmyownquestion:Insteadofsettingupa"Source"fortheta

水平滚动方向的 iOS7 UICollectionView 不起作用

适用于iOS6的相同代码运行良好。由于某些原因更新到iOS7并使用此布局UICollectionViewFlowLayout*flowLayout=[[UICollectionViewFlowLayoutalloc]init];[flowLayoutsetScrollDirection:UICollectionViewScrollDirectionHorizontal];/CGSizes=CGSizeMake(self.collectionView.frame.size.height,self.collectionView.frame.size.height);[flowLayouts

ios - UICollectionView 选择不会持续

我有一个UICollectionView我用它作为工具选择容器。你有很多工具(单元格),当你选择一个时,前一个选择被取消选择,依此类推......你一次只能选择一个工具。问题是我无法选择单元格。当我点击单元格时,将调用collectionView:didSelectItemAtIndexPath:。然后,我使用[collectionViewreloadItemsAtIndexPaths:@[indexPath]]重新加载所选单元格以更改其外观(我更改图像的alpha)。好的,重新加载单元格,除了一件该死的事情:在collectionView:cellForItemAtIndexPath

ios - 删除 UICollectionView 中的最后一个 Cell 会导致崩溃

您好,我正在使用自定义UICollectionView(https://github.com/SureCase/WaterfallCollectionView),一切正常。现在我正在设置从UICollectionView中删除项目,我可以很好地删除它们。当我试图删除该部分的最后一项时,问题就来了。它给出了以下错误。***Assertionfailurein-[UICollectionViewDatalayoutAttributesForSupplementaryElementOfKind:atIndexPath:],/SourceCache/UIKit/UIKit-2935.137/U

ios - UICollectionView 单元格的自定义委托(delegate) - 自定义按钮不起作用

我有一个从UIcollectionViewCell子类化的自定义单元格。通过代码,我创建了按钮并使用同一类中的目标方法将其添加到单元格中。按钮事件工作正常。但是我需要控制我创建UICollectionView的基本View。为此,我创建了用于识别点击事件的自定义委托(delegate)。--->DBDraggingCell.h文件@protocolDBDraggingCellDelegate-(void)chartButtonpressed:(id)sender;-(void)accountHistoryButtonpressed:(id)sender;-(void)transacti

iOS 向 UICollectionView 添加页脚不起作用

我需要在collectionView的底部添加一些空间,我正在尝试使用一些页脚,这还行不通,-(void)viewDidLoad{[superviewDidLoad];[selfinitTestDataSource];self.collectionView.delegate=self;self.collectionView.dataSource=self;[self.collectionViewregisterClass:[DOPCollectionViewCellclass]forCellWithReuseIdentifier:@"DOPCollectionViewCell"];[s

iOS UICollectionView : Cells not showing

我在这里遗漏了一些明显的东西,因为这不是一项艰巨的任务。我在Storyboard中有我的CollectionView(在其他View中),原型(prototype)单元格的重用ID是“Cell”,该单元格中有一个UILabel,标签为100。代码(样板):-(NSInteger)numberOfSectionsInCollectionView:(UICollectionView*)collectionView{return1;}-(NSInteger)collectionView:(UICollectionView*)collectionViewnumberOfItemsInSecti

ios - 如何在布局转换期间为 UICollectionView 单元格的边框宽度/颜色设置动画?

我有一个UICollectionView,它使用UICollectionViewFlowLayout的自定义子类。这又使用了UICollectionViewLayoutAttributes的自定义子类,其属性会影响单元格的边框颜色和粗细等。在我的CollectionView上执行动Canvas局更改时,如何将这些内容包含在动画中?实现细节:在MyLayoutAttributes中说,我有一个枚举属性LayoutType,其值为TypeBig和TypeSmall。我有一个单元格类MyCell和一个UILabel作为subview。在那个单元格类中,我做了这样的事情:-(void)appl

ios - 未调用 UICollectionView cellForItemAtIndexPath 方法

cellForItemAtIndexPath未被调用。我觉得一切都很正常有什么问题?-(NSInteger)numberOfSectionsInCollectionView:(UICollectionView*)collectionView{return1;}-(NSInteger)collectionView:(UICollectionView*)collectionViewnumberOfItemsInSection:(NSInteger)section{return10;}-(UICollectionViewCell*)collectionView:(UICollectionVi