如何从UITableView删除页眉和页脚空间? [英] How to remove header and footer space from a UITableView?

查看:92
本文介绍了如何从UITableView删除页眉和页脚空间?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个分组样式的UITableView,只有一个部分.但是,当用户滚动得太远时,表格视图的上方和下方都有一些空白.如何删除该空白?

I have a UITableView in the grouped style, and only one section. However there is some blank space above and below the table view that is shown when the user scrolls too far. How can I remove this blank space?

推荐答案

您可以通过更改表视图从UIScrollView继承的contentInset属性来实现.

You can do this by altering the contentInset property that the table view inherits from UIScrollView.

self.tableView.contentInset = UIEdgeInsetsMake(-20, 0, -20, 0);

这将使顶部和底部接触边缘.

This will make the top and bottom touch the edge.

这篇关于如何从UITableView删除页眉和页脚空间?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆