开发者

UITableViewHeader (fix position)

开发者 https://www.devze.com 2022-12-23 22:24 出处:网络
I added a UITableviewHeader to my tableview, is there a way to make it fix. I want to scroll with my TableView but always be abl开发者_JS百科e to watch the Header.If your table has only one section, y

I added a UITableviewHeader to my tableview, is there a way to make it fix. I want to scroll with my TableView but always be abl开发者_JS百科e to watch the Header.


If your table has only one section, you can use a section header instead of a table header, and it should do what you want. If not, use Rengers' suggestion.


There is currently no way to achieve this using a standard UITableViewHeader. You'll have to shrink the UITableView and put a UIView at the top if you want this behavior.

As far as I know a UITableViewController doesn't allow you to change the UITableView frame, so you should create a 'container' UIView with an UITableView in it and a custom UIViewController subclass that controls is.

0

精彩评论

暂无评论...
验证码 换一张
取 消