背景
我正在实现UICollectionView(第一次)努力实现切片的分页水平滚动视图.我希望每个瓷砖显示在框架的中央,它的左边和右边部分可见的姐妹瓷砖(类似于Safari应用程序中的页面选择器).我有兴趣使用它UICollectionView来利用内置的单元格出列,而不是使用旋转UITableView.
问题
我发现的问题是,当使用pagingEnabled = YES和时clipsToBounds = NO,一旦分页完成,就UICollectionView删除collectionView帧外的单元格(它们不在visibleCells数组中).任何人都可以提供如何在保持这种基本设置的同时实现显示姐妹瓷砖预览效果的建议吗?或者我接近这个错误?
截图
开始
滚动
结束

在滚动屏幕是完全正确的.但是在开始和结束镜头中,我希望在蓝色边缘可以看到绿色.
这是我的AppDelegate.m中的内容(在此基本设置中归功于tutsplus.com):
#import "AppDelegate.h"
@interface ViewController : UICollectionViewController
@end
@implementation ViewController
- (void)viewDidLoad
{
[super viewDidLoad];
[self.collectionView registerClass:[UICollectionViewCell class] forCellWithReuseIdentifier:@"ID"];
[self.view setBackgroundColor:[UIColor blueColor]];
// pad the collection view by 20 px
UIEdgeInsets padding = UIEdgeInsetsMake(20.0, 20.0, 20.0, 20.0);
[self.collectionView setFrame:UIEdgeInsetsInsetRect(self.view.frame, padding)];
// set pagingEnabled and clipsToBounds off
[self.collectionView …Run Code Online (Sandbox Code Playgroud)