CollctionView添加头部视图,不是sectionHeader
来源:互联网 发布:盲打高手打飞字 源码 编辑:程序博客网 时间:2024/06/05 19:48
self.collectionView = [[UICollectionView alloc] initWithFrame:CGRectMake(0, 0, 320, self.view.frame.size.height) collectionViewLayout:flowlayout];self.collectionView.contentInset = UIEdgeInsetsMake(50, 0, 0, 0);UIImageView *imagev = [[UIImageView alloc]initWithImage:[UIImage imageNamed:@"015.png"]];imagev.frame = CGRectMake(0, -50, 320, 50);[self.collectionView addSubview: imagev];[self.view addSubview: _collectionView];
I use the attribute contentInset
to insert a frame to the top of the UICollectionView
, then I add the image view to it, and it succeeds. I think it can act excactly as UITableView
's tableHeaderView
property. What do you think?
0 0
- CollctionView添加头部视图,不是sectionHeader
- UIWebView添加头部视图
- PullToRefreshBase添加头部视图
- 在CollectionView添加头部视图
- StikkyHeader——为滚动视图添加粘性头部
- SWIFT写的web view添加头部与尾部视图
- RecyclerView封装Adapter之添加头部和底部视图
- UITableView添加头部视图,并解决添加后无法滑动的问题
- iOS创建头部视图
- HeadChooseView头部视图滑动
- collectionView添加头部view
- PullToRefreshListView添加头部需求
- RecyclerView添加头部
- RecyclerViewHeader 添加头部
- CollectionView添加头部
- PullToRefreshGridView添加头部
- 添加头部标题
- Android_ListView头部添加ViewPager,
- 安卓实现安装apk
- Android之back键拦截处理
- Date UTC timezone在js json web server中关系探究
- Android Service完全解析,关于服务你所需知道的一切(上)
- ios进阶--Autolayout 之第三方框架--Masonry
- CollctionView添加头部视图,不是sectionHeader
- 《Ted:记忆的虚构》——Elizabeth Loftus(有感)
- getExtras()方法
- android 源码大全总结
- 动态规划解决最长公共子序列和最长公共子串
- 关于wpf 构造函数执行符合指定的绑定约束的调用时引发了异常
- mac下android环境搭建笔记(android studio)
- Kafka学习整理八(topic管理)
- js中如何快速获取数组中的最大值最小值