iOS UITableViews - 移出屏幕截面的标题 [英] iOS UITableViews - moving header of a section off screen

查看:88
本文介绍了iOS UITableViews - 移出屏幕截面的标题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个带标题的UITableView。当我在不适合屏幕上所有元素的部分中滚动时,我希望标题移出屏幕而不是保持在顶部的正常行为,直到它被另一部分替换。

I have a UITableView with a header. When I scroll in the section that does not fit all its elements on the screen, I'd like the header to move off screen instead of the normal behavior of staying on top until it is replaced by another section.

这可行吗?我想避免使标题成为UITableView行,就像该节中的元素一样。

Is this doable? I would like to avoid making the header a UITableView row like the elements within the section.

谢谢!

推荐答案

如aBitObvious建议的那样,使用Grouped Tableview来实现节目标题关闭影响。为我的项目提供所需的背景清晰需要进行一些搜索,因为有一个关键线不是那么直观。

As aBitObvious suggested, use a Grouped Tableview to achieve the section header going off affect. Getting the background clear which is what I require for my project required a bit of searching because there is one critical line that is not so intuitive.

self.tableview.backgroundColor = [UIColor clearColor];
self.tableview.opaque = NO;
self.tableview.backgroundView = nil; // THIS ONE TRIPPED ME UP!
self.tableview.separatorColor = [UIColor clearColor];

这篇关于iOS UITableViews - 移出屏幕截面的标题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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