解决方案 »
- C++求入门IOS开发 麻烦大大进来给点建议 谢谢
- 请问IOS中要如何引用多个自定义控件
- 有没有宏可以区别debug模式和release模式?
- NSUInteger row = [indexPath row];
- 关于objective-c 类目(Category),遇到的问题新手求助!
- 求一份xcode4.2
- 开始学习ios,菜鸟凑个热闹。
- 学MJ的汤姆猫视频遇到imageWithContentsOfFile问题。。
- iOS的ARC究竟是如何释放内存的?
- 请问怎么确定一个app是不是原生开发
- table view controller中某行连续点击存在的问题
- UIButton添加到IOS7的UITableviewCell上时Highlighted效果不起作用
@interface CollectionViewController : UICollectionViewController <UICollectionViewDelegateFlowLayout>
@end
m文件
- (void)viewDidLoad
{
[super viewDidLoad];
self.collectionView.contentSize = CGSizeMake(320 *2, 568);
}
-(NSInteger)collectionView:(UICollectionView *)collectionView numberOfItemsInSection:(NSInteger)section{
return 5;
}
-(UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath{
static NSString * identifierCell =@"cell";
CollectionCell *cell = [collectionView dequeueReusableCellWithReuseIdentifier:identifierCell forIndexPath:indexPath];
cell.lab.text = @"string";
[cell.pic setBackgroundColor:[UIColor blueColor]];
return cell;
}
布局是直接在storyboard里面托动的
http://download.csdn.net/download/zhangao0086/7736017
简单地说,就是你不用直接去设置self.collectionView.contentSize,而且设置了也没用
实际的contentSize由你item的数量*item的宽度决定,这是没有问题的
实际的contentSize由你item的数量*item的宽度决定,这是没有问题的
这个是我的demo,同样是定义的5个cell,横向滑动,在首页显示4个cell,然后滑动在第二页只显示剩余的一个cell。可是只能滑动一半
实际的contentSize由你item的数量*item的宽度决定,这是没有问题的
已经搞定了
实际的contentSize由你item的数量*item的宽度决定,这是没有问题的
已经搞定了
解决就好
实际的contentSize由你item的数量*item的宽度决定,这是没有问题的
已经搞定了
解决就好
谢谢额
实际的contentSize由你item的数量*item的宽度决定,这是没有问题的
已经搞定了
怎么解决的?求教,我也要做分页效果