UITabelView section headerView浮动问题
2014-07-09 23:37
218 查看
解决方案一:
headerView 直接添加到 self.tableView.headerView 中
解决方案二:(多 section 情况下建议使用)
更改 TabelViewStyle 为 Grouped
UITableViewStyleGrouped 多个 section之间 间距调整
显示效果的各个section间距其实是section头部和底部的组合。配置他们的间距就是配置各个section的头部和底部。
经过测试,height = 1时 无法实现更改,设置为1.1即可
headerView 直接添加到 self.tableView.headerView 中
解决方案二:(多 section 情况下建议使用)
更改 TabelViewStyle 为 Grouped
UITableViewStyleGrouped 多个 section之间 间距调整
显示效果的各个section间距其实是section头部和底部的组合。配置他们的间距就是配置各个section的头部和底部。
经过测试,height = 1时 无法实现更改,设置为1.1即可
- (CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section { return 1;//section头部高度 } //section头部视图 - (UIView *)tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section { UIView *view=[[UIView alloc] initWithFrame:CGRectMake(0, 0, 320, 1)]; view.backgroundColor = [UIColor clearColor]; return [view autorelease]; } //section底部间距 - (CGFloat)tableView:(UITableView *)tableView heightForFooterInSection:(NSInteger)section { return 1; } //section底部视图 - (UIView *)tableView:(UITableView *)tableView viewForFooterInSection:(NSInteger)section { UIView *view=[[UIView alloc] initWithFrame:CGRectMake(0, 0, 320, 1)]; view.backgroundColor = [UIColor clearColor]; return [view autorelease]; }
相关文章推荐
- 下拉刷新和UITableView的sectionHeaderView冲突的问题
- 自定义tableView的section header/footerView时的view复用问题
- viewForHeaderInSection 复用问题
- UITableView的Grouped模式下,tableHeaderView与第一个section之间的空隙变大问题
- 折叠表格思路及遇到的问题(tableView:viewForHeaderInSection:的section从1开始,不是从0开始)
- ios tableView 的header for section无法加载的问题
- 解决tableview下滑隐藏HeaderInSection的问题
- 【iOS开发】关于Xcode8后产生的viewForHeaderInSection、viewForFooterInSection设置不产生效果的问题
- tableview的第一个section的header悬浮问题
- tableView设置多个section 的 headerView 粘合性问题
- iOS Tableview中解决plain样式下,header的浮动问题
- qt 5.0中HeaderView的setResiziMode无法使用的问题
- 关于TableView中不止一个section的情况下首个cell的y轴不为0的会造成的问题和解决办法
- UITabelView GroupStyle 不同Section中自定义Cell For Row(xib模式)
- 给ListView加HeaderView时遇到的问题
- IOS 解决tableView header 跟着滑的问题
- ViewPager+ViewPager作为HeaderView 滚动问题
- 问题解决:listview多次调用addHeaderView和addFooterView
- 问题解决:listview多次调用addHeaderView和addFooterView
- 下拉刷新和UITableView的section headerView冲突的原因分析与解决方案