如何在Swift 2.0中使标题单元格与TableView单元格一起移动 [英] How do i keep the header cell moving with the tableview cells in Swift 2.0

查看:86
本文介绍了如何在Swift 2.0中使标题单元格与TableView单元格一起移动的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试创建一个表视图,该表视图在表视图的中间开始,然后可以向上滚动,将添加的tableView单元格向上滚动到顶部,然后停止,然后该表视图单元格可以在其下方"滚动.我将标题放置在tableview的中间,但是tableView Cells只是在其顶部滚动,而header并没有真正滚动到顶部.它只是留在原地.我希望能够让标题在您滚动列表时移动,然后在到达列表顶部时停止,然后仅是随后移动的tableView单元格.

I am trying to create a tableview which starts the header in the middle of the tableview and then can be scrolled up with the added tableView Cells to the top then stops, and then the tableview cells can just scroll "under" it. I got the header to be in the middle of the tableview, but the tableView Cells just scroll on top of it, and the header doesnt really scroll to the top. it just stay where it is. I want to be able to let the header move as you scroll the list, and then stops when it reaches the top of the list, and then its just the tableView Cells that are moving afterwards.

我正在使用最新版本的XCode

I am using the latest version of XCode

推荐答案

转到故事板>选择视图>选择表视图>属性检查器>将样式从PLAIN分组到一起

GO TO STORYBOARD > SELECT VIEW > SELECT TABLEVIEW > PROPERTY INSPECTOR > CHNAGE STYLE TO GROUPPED from PLAIN

别忘了处理footerview.在分组模式下,页脚将出现并排列背景或其他属性.他们会改变.

Don't forget to handle footerview. In Groupped mode a footer will appear and arrange background or other properties. They will change.

参见图片:

这篇关于如何在Swift 2.0中使标题单元格与TableView单元格一起移动的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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