草庐IT

collectionViews

全部标签

ios - 删除 collectionview 中各部分之间的空间

如何调整CollectionView各部分之间的间距。 最佳答案 您可以使用该方法来实现:-(UIEdgeInsets)collectionView:(UICollectionView*)collectionViewlayout:(UICollectionViewLayout*)collectionViewLayoutinsetForSectionAtIndex:(NSInteger)section{//{top,left,bottom,right}if([[sectionHeaderStatusArrayobjectAtIndex

ios - 如何以编程方式选择 collectionview 中的项目?

我有一个UICollectionView。UICollectionView的datasource是学生的NSArray(来自CoreData)。我希望当前学生项被选中/突出显示。我该怎么做?我知道有一个方法:-(void)selectItemAtIndexPath:(NSIndexPath*)indexPathanimated:(BOOL)animatedscrollPosition:(UICollectionViewScrollPosition)scrollPosition;它以NSIndexPath和UICollectionViewScrollPosition作为参数。我有数据源(

ios - 如何以编程方式选择 collectionview 中的项目?

我有一个UICollectionView。UICollectionView的datasource是学生的NSArray(来自CoreData)。我希望当前学生项被选中/突出显示。我该怎么做?我知道有一个方法:-(void)selectItemAtIndexPath:(NSIndexPath*)indexPathanimated:(BOOL)animatedscrollPosition:(UICollectionViewScrollPosition)scrollPosition;它以NSIndexPath和UICollectionViewScrollPosition作为参数。我有数据源(

ios - 使用 Storyboard在 CollectionView 中仅显示两列,多行

无论iPhone屏幕尺寸如何,我只想连续显示两个单元格。喜欢,我的Storyboard包含一个UICollectionView,通过约束连接。UICollectionView的Storyboard设置是,现在,当我在6秒、5秒或更短时间内运行此程序时,一行中只会出现一个单元格。我使用的代码是,-(NSInteger)collectionView:(UICollectionView*)collectionViewnumberOfItemsInSection:(NSInteger)section{return[categoryImagescount];}-(UICollectionView

ios - 使用 Storyboard在 CollectionView 中仅显示两列,多行

无论iPhone屏幕尺寸如何,我只想连续显示两个单元格。喜欢,我的Storyboard包含一个UICollectionView,通过约束连接。UICollectionView的Storyboard设置是,现在,当我在6秒、5秒或更短时间内运行此程序时,一行中只会出现一个单元格。我使用的代码是,-(NSInteger)collectionView:(UICollectionView*)collectionViewnumberOfItemsInSection:(NSInteger)section{return[categoryImagescount];}-(UICollectionView

ios - CollectionView sizeForItemAtIndexPath 从未调用过

这让我发疯!我有一个UICollectionViewController,如下所示:classPhrasesCompactCollectionViewController:UICollectionViewController正在调用numberOfSections和cellForItemAt,但从未调用sizeForItemAtIndexPath。我在其他地方使用完全相同的代码并且它正确触发。我正在使用Xcode8Beta6。funccollectionView(collectionView:UICollectionView,layoutcollectionViewLayout:UIC

ios - CollectionView sizeForItemAtIndexPath 从未调用过

这让我发疯!我有一个UICollectionViewController,如下所示:classPhrasesCompactCollectionViewController:UICollectionViewController正在调用numberOfSections和cellForItemAt,但从未调用sizeForItemAtIndexPath。我在其他地方使用完全相同的代码并且它正确触发。我正在使用Xcode8Beta6。funccollectionView(collectionView:UICollectionView,layoutcollectionViewLayout:UIC

ios - 在 collectionView 中设置最小行距

我试图在我的collectionViewController中使用swift设置最小行间距,但我似乎无法找到我需要使用的方法。我需要以编程方式进行,因为我需要根据selectedSegmentedIndex动态更改它。如何以编程方式更改最小行间距?我尝试添加UICollectionViewFlowLayout,但不能,因为它是一个UICollectionViewController。我想我需要使用类似的东西。collectionView:layout:minimumLineSpacingForSectionAtIndex: 最佳答案

ios - 在 collectionView 中设置最小行距

我试图在我的collectionViewController中使用swift设置最小行间距,但我似乎无法找到我需要使用的方法。我需要以编程方式进行,因为我需要根据selectedSegmentedIndex动态更改它。如何以编程方式更改最小行间距?我尝试添加UICollectionViewFlowLayout,但不能,因为它是一个UICollectionViewController。我想我需要使用类似的东西。collectionView:layout:minimumLineSpacingForSectionAtIndex: 最佳答案

ios - 如何在 tvOS 应用程序中为 collectionview 的节标题设置动画?

当标题下方的集合单元格获得焦点时,需要为节标题标题设置动画。就像你在appletv上转到“电影itunes”应用程序并转到顶部电影选项卡一样,如果你查看下面的播放列表,当你滚动项目时,标题会上下动画,以免与焦点单元格重叠。任何帮助表示赞赏tvosscreenshotlink 最佳答案 我无法准确提供代码;但这基本上就是您想要做的。1-创建一个中介classheadingRouter;其目的是在scrollView标题(collectionView或tableView)和单元格选择之间进行调解。标题路由器的实例将存在于您的collec