CollectionView Ios 6 issue



我正在从事项目上的工作数量。

我已经实施了WaterFlowLayout收集视图开源GitHub项目https://github.com/aceisscope/waterflowview

图像动态分配给收集视图图像数组。

如果收集视图源有图像计数3或更多。

但是,如果要显示的图像计数小于3,则比在收集视图中显示的图像不显示。在演示项目中也发生了一样。

我还实现了一件事,也可以刷新,但是在单页中可以显示近12张图像,如果图像计数超过13张,超过收集默认滚动的滚动功能正常,我能够刷新刷新,但是如果图像计数小于12,比我无法访问刷新胶水的视图。

如果NumberOfitemSinsection为3一行比代码正常工作。

 - (NSInteger)collectionView:(UICollectionView *)collectionView numberOfItemsInSection:(NSInteger)section
    {
        return 3;
    }
#pragma mark- UICollectionViewDatasourceFlowLayout
    - (NSInteger)numberOfColumnsInFlowLayout:(WaterFlowLayout*)flowlayout
    {
        return 3;
    }

但是,如果NumberOfitemSinsection为2,而数字ofcolumnsinflayout也为3表示它未完成一行,我将无法显示图像。

    - (NSInteger)collectionView:(UICollectionView *)collectionView numberOfItemsInSection:(NSInteger)section
    {
        return 2;
    }
#pragma mark- UICollectionViewDatasourceFlowLayout
    - (NSInteger)numberOfColumnsInFlowLayout:(WaterFlowLayout*)flowlayout
    {
        return 3;
    }

,任何人都可以提出一些技巧,即使排序视图默认滚动不活动。

预先感谢...

您可能会考虑跳过WaterFlowLayout存储库,然后使用UicollectionView:

  1. 要开始使用UicollectionView,请查看Bryan Hansen的这一出色教程。它会让您熟悉UicollectionView。

  2. 如果您使用的是UICollectionView,则可以在UICollectionViewControllerviewDidLoad方法中添加仅使用几行代码的拉力到删除控件:

    UIRefreshControl *refreshControl = [[UIRefreshControl alloc] init];
    [refreshControl addTarget:self action:@selector(startRefresh:) forControlEvents:UIControlEventValueChanged];
    [self.collectionView addSubview:refreshControl];
    
  3. 要实现Pinterest风格的瀑布布局,您可以使用此uicollectionViewLayout github存储库,或其他任何其他存储库:https://github.com/jayslu/jayslu/jspintdemo

    /li>

最新更新