IOS:UICollectionView内部UIScrollView索引未增加

IOS:UICollectionView内部UIScrollView索引未增加,ios,iphone,scrollview,collectionview,Ios,Iphone,Scrollview,Collectionview,stackoverflow的人们好 [flowLayout setItemSize:CGSizeMake(148, 148)]; 目前正在开发一个应用程序,其中我的用户配置文件如下所示 [flowLayout setItemSize:CGSizeMake(148, 148)]; (对不起,我没有足够的声誉来发布图片) [flowLayout setItemSize:CGSizeMake(148, 148)]; 标题视图是用户的图片。 选项卡视图有两个选项卡,一个带有collectionvi

stackoverflow的人们好

[flowLayout setItemSize:CGSizeMake(148, 148)];
目前正在开发一个应用程序,其中我的用户配置文件如下所示

[flowLayout setItemSize:CGSizeMake(148, 148)];
(对不起,我没有足够的声誉来发布图片)

[flowLayout setItemSize:CGSizeMake(148, 148)];
标题视图是用户的图片。 选项卡视图有两个选项卡,一个带有collectionview,另一个带有tableview

[flowLayout setItemSize:CGSizeMake(148, 148)];
所有这些视图都嵌套在scrollView中

[flowLayout setItemSize:CGSizeMake(148, 148)];
我的问题是,当我滚动该视图时(集合视图高度设置程序取决于元素的数量),集合视图的索引不会增加。集合视图的可见单元格索引中仅加载前6项

[flowLayout setItemSize:CGSizeMake(148, 148)];
我需要从collectionview的项目切换到项目的详细视图

[flowLayout setItemSize:CGSizeMake(148, 148)];
如何使用scrollView委托了解集合视图的位置

[flowLayout setItemSize:CGSizeMake(148, 148)];
我已经看过这些线索:

[flowLayout setItemSize:CGSizeMake(148, 148)];
但是没有人给我我想要的答案

[flowLayout setItemSize:CGSizeMake(148, 148)];
我还尝试查看ScrollViewDiEnd减速,并根据scroll view offset设置收藏视图滚动偏移,但无法使其正常工作

[flowLayout setItemSize:CGSizeMake(148, 148)];
有什么建议吗

[flowLayout setItemSize:CGSizeMake(148, 148)];
谢谢

[flowLayout setItemSize:CGSizeMake(148, 148)];
编辑:

[flowLayout setItemSize:CGSizeMake(148, 148)];
您好,谢谢您的回答

[flowLayout setItemSize:CGSizeMake(148, 148)];
为了回答您的问题,我可以滚动我的collectionview,因为它在滚动视图中,我在viewdidload期间设置了我的collectionview高度(基于元素数量)

[flowLayout setItemSize:CGSizeMake(148, 148)];
我的问题是,我可以单击前6个项目,并显示详细信息(通过一个序列),但在这之后,选择不被识别,因为我的集合视图的索引没有刷新。我可以一直滚动到收藏视图的底部(我通过scrollView滚动)

[flowLayout setItemSize:CGSizeMake(148, 148)];
我的collectionView已选中用户交互,正如我所说,我可以选择前6项,然后选择不被识别

[flowLayout setItemSize:CGSizeMake(148, 148)];
我理解UICollectionViewFlowLayout的问题,但这一行应该写在哪里?在viewDidLoad中?还是在CollectionView的委托函数中

[flowLayout setItemSize:CGSizeMake(148, 148)];
如果您需要更多信息,我可以复制一些代码或在故事板中显示视图的布局

[flowLayout setItemSize:CGSizeMake(148, 148)];
提前谢谢

[flowLayout setItemSize:CGSizeMake(148, 148)];
编辑2:

[flowLayout setItemSize:CGSizeMake(148, 148)];
图像,情节提要:我的视图布局

[flowLayout setItemSize:CGSizeMake(148, 148)];

[flowLayout setItemSize:CGSizeMake(148, 148)];
代码,以下是collectionView的数据源函数

[flowLayout setItemSize:CGSizeMake(148, 148)];

[flowLayout setItemSize:CGSizeMake(148, 148)];
集合视图的委托函数

[flowLayout setItemSize:CGSizeMake(148, 148)];

[flowLayout setItemSize:CGSizeMake(148, 148)];
编辑3:

[flowLayout setItemSize:CGSizeMake(148, 148)];
好的,基本上这就是我想要复制的

[flowLayout setItemSize:CGSizeMake(148, 148)];
在中间带有多视图标签的集合视图,所有这些都是可滚动的。 我不能理解的是,如果我将我的topView设置为CollectionView的标题,我就不能像我想的那样切换选项卡,因为它在标题内

[flowLayout setItemSize:CGSizeMake(148, 148)];

您好首先,我需要有关您的问题的更多详细信息,但我假设您希望您的UICollectionView可滚动,而实际上它不可滚动

[flowLayout setItemSize:CGSizeMake(148, 148)];
因此,您能否检查以下几点:-

[flowLayout setItemSize:CGSizeMake(148, 148)];
  • 应启用集合视图的UserEnableInteraction

  • [flowLayout setItemSize:CGSizeMake(148, 148)];
    
  • ,同时检查UILCultDeVIEW流布局的值是什么,因为只考虑是否有5个元素显示,并且UICRealDebug视图流布局大小可以显示可见单元格索引中的所有五个条目,那么它不滚动,因此需要增加UICLoopDebug视图流布局的大小以使其滚动。 e、 g

  • [flowLayout setItemSize:CGSizeMake(148, 148)];
    
    UICollectionViewFlowLayout*flowLayout=[[UICollectionViewFlowLayout alloc]init]

    [flowLayout setItemSize:CGSizeMake(148, 148)];
    
  • 如果需要,可以从UIScrollViewDelegate方法获得帮助,如

    [flowLayout setItemSize:CGSizeMake(148, 148)];
    
    - (void)scrollViewDidEndDragging:(UIScrollView *)scrollView willDecelerate:(BOOL)decelerate
    {
    if (!decelerate)
    {
        // do your job
    }
    }
    

  • .h

    [flowLayout setItemSize:CGSizeMake(148, 148)];
    
    #import <UIKit/UIKit.h>
     @interface ViewController : UIViewController<UITableViewDataSource , UITableViewDelegate ,         
      UIScrollViewDelegate , UICollectionViewDataSource , UICollectionViewDelegateFlowLayout>
    
    然后给她打电话:-

    [flowLayout setItemSize:CGSizeMake(148, 148)];
    
     - (NSInteger)collectionView:(UICollectionView *)collectionView numberOfItemsInSection:(NSInteger)section
    {
        return [arrImages count];
    }
    
    - (UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath
    {
        UICollectionViewCell *cell=[collectionView dequeueReusableCellWithReuseIdentifier:@"cellIdentifier" forIndexPath:indexPath];
        [self createCell:cell forTableview:collectionView];
    
        [self fillCell:cell cellForRowAtIndex:indexPath];
         return cell;
    }
    
    //- (CGSize)collectionView:(UICollectionView *)collectionView layout:(UICollectionViewLayout*)collectionViewLayout sizeForItemAtIndexPath:(NSIndexPath *)indexPath
    //{
    //    return CGSizeMake(50, 50);
    //}
    

    请澄清您想问的问题我的问题很简单:我无法选择viewDidLoad后不可见的任何项目,我的collectionview嵌套在scrollview中,我使用scrollview滚动。我的集合视图indexpath未更新,我无法选择任何超过6个第一个选项的项目扫描您更新有关您的问题的一些图像或代码。您好,我添加了一些屏幕截图(故事板、代表和数据源)。我将我的答案发布在下面,您是否知道?您好,这没有回答我的问题。我知道如何设置集合视图,我已经加载了项目,这是一个屏幕,解释了我能做什么和不能做什么对不起,伙计,我不知道这类问题,如果我找到了解决方案,我会发布给你。谢谢,如果你看我的EDIT3,我发现了一个与我类似的问题,他们说要将集合视图放在uitableviewcell中,对此不太确定