UITableView的表头表尾(tableHeaderView,tableFooterView) 和 组头组尾(viewForHeaderInSection,heightForFooterInSec

来源:互联网 发布:java mysql连接池配置 编辑:程序博客网 时间:2024/05/17 03:05


tableHeaderViewtableFooterView会随着cell移动而移动。


viewForHeaderInSectionheightForFooterInSection會一直固定在那裡。如果想要其与cell移动移动,可作相应处理。

// UITableViewController为UITableViewStylePlain样式,viewForHeaderInSection会有悬停效果。如果UITableViewController为UITableViewStyleGrouped样式,则不会有悬停效果,会跟着cell移动。

问题:UITableViewStyleGrouped样式默认顶部有空白(底部有没有空白的问题,占无设置,可自行设置查看)

        if (style ==UITableViewStyleGrouped) {//去掉 UITableViewStyleGrouped类型顶部空白

            self.tableHeaderView = [[UIViewalloc] initWithFrame:CGRectMake(0,0, SCREEN_WIDTH,CGFLOAT_MIN)];

        }

阅读全文
1 0
原创粉丝点击