iOS cell紧贴导航栏
2015-06-30 17:21
441 查看
//确保第一区域紧贴导航栏
- (void)viewWillAppear:(BOOL)animated
{
CGRect frame = _tableView.tableHeaderView.frame;
frame.size.height = 1;
UIView *headerView = [[UIView alloc] initWithFrame:frame];
[_tableView setTableHeaderView:headerView];
}
//section头部间距
- (CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section{
return 0.01;//section头部高度
}
//section头部视图
- (UIView *)tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section{
UIView *view=[[UIView alloc] initWithFrame:CGRectMake(0, 0, 320, 0)];
view.backgroundColor = [UIColor clearColor];
return view;
}
- (void)viewWillAppear:(BOOL)animated
{
CGRect frame = _tableView.tableHeaderView.frame;
frame.size.height = 1;
UIView *headerView = [[UIView alloc] initWithFrame:frame];
[_tableView setTableHeaderView:headerView];
}
//section头部间距
- (CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section{
return 0.01;//section头部高度
}
//section头部视图
- (UIView *)tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section{
UIView *view=[[UIView alloc] initWithFrame:CGRectMake(0, 0, 320, 0)];
view.backgroundColor = [UIColor clearColor];
return view;
}
相关文章推荐
- iOS keyboard遮挡textfiled的问题
- ios调节系统屏幕亮度
- iPhone4S加载大图崩溃的问题
- [IOS]对视频、音频播放器添加缓冲进度条
- ios绘图
- [iOS]获取设备具体型号信息
- ios获取当前语言
- ios输入框被键盘挡住的解决办法
- iOS CoreImage图片处理动态渲染(滤镜)
- ios8 自动安装不好用的问题
- iOS6中的Auto Layout:通过代码添加约束
- iOS and OS X Network Programming Cookbook |Retrieving network address information
- iOS开发拓展篇-XMPP简单介绍
- iOS开发拓展篇—应用之间的跳转和数据传递
- iOS开发拓展篇—xib中关于拖拽手势的潜在错误
- iOS开发拓展篇—音频处理(音乐播放器6)
- iOS开发拓展篇—音频处理(音乐播放器5)
- iOS开发拓展篇—音频处理(音乐播放器4)
- iOS开发拓展篇—音频处理(音乐播放器3)
- iOS开发拓展篇—音频处理(音乐播放器2)