
-(CGfloat) tableVIEw:(UItableVIEw *)tableVIEw heightForheaderInSection:(NSInteger)section {CGfloat height = 0.0001;return height;}-(CGfloat) tableVIEw:(UItableVIEw *)tableVIEw heightForFooterInSection:(NSInteger)section {CGfloat height = 0.0001;return height;}-(UIVIEw *) tableVIEw:(UItableVIEw *)tableVIEw vIEwForheaderInSection:(NSInteger)section {// Create Empty VIEwUIVIEw *vIEw = [[UIVIEw alloc] initWithFrame:CGRectMake(0.0,0.0,self.vIEw.frame.size.wIDth,[self tableVIEw:self.visitorListsTv heightForheaderInSection:section]) ];return vIEw;}-(UIVIEw *) tableVIEw:(UItableVIEw *)tableVIEw vIEwForFooterInSection:(NSInteger)section {// Create Empty VIEwUIVIEw *vIEw = [[UIVIEw alloc] initWithFrame:CGRectMake(0.0,[self tableVIEw:self.visitorListsTv heightForFooterInSection:section]) ];return vIEw;} 使用上面的代码,页脚部分被隐藏.但是也无法隐藏标题.
查看解决方案的其他链接我还在VIEw中添加了tableVIEw,为tablevIEw添加了约束,但仍然是标题部分仍然是它们的.
我哪里错了?如何摆脱它?
解决方法 如果您尝试删除UItableVIEw上方的空格,请尝试更改它的contentInset属性,而不是使用较小的高度制作自定义标题:self.tableVIEw.contentInset = UIEdgeInsetsMake(-20.0f,0.0f,0.0f);
您可能需要调整第一个数字以将其调整到特定的视图场景.
了解这也是一种解决方法(source),但它比创建自定义表视图头更干净.
总结以上是内存溢出为你收集整理的iOS UITableView隐藏标题空间全部内容,希望文章能够帮你解决iOS UITableView隐藏标题空间所遇到的程序开发问题。
如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。
欢迎分享,转载请注明来源:内存溢出
微信扫一扫
支付宝扫一扫
评论列表(0条)