ios - 像 App Store 一样具有固定标题弹跳效果的列表

标签 ios swift uitableview uiscrollview

我想做一个固定表头的UITableView,像App Store一样,在表头下方有弹跳效果:

App Store GIF

我试过 UIScrollView with a UITableView with scrollEnabled NO .没用;它没有使标题下方的弹跳效果:

enter image description here

我的观点: enter image description here

最佳答案

我终于找到了一个解决方案。 基本上我创建了一个 UITableView 和一个标题,它们都具有清晰的背景颜色。然后我在 Controller View 和 tableView 之间添加一个新 View (与标题 tableView 具有相同的高度),位于顶部。这个新 View 是标题。 然后我使用函数 scrollViewDidScroll 来管理模拟标题的 View 的位置。 这样我就可以在标题下方的 tableView 中实现弹跳

我做了一个例子,你可以下载here

关于ios - 像 App Store 一样具有固定标题弹跳效果的列表,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42120346/

相关文章:

ios - UITableViewController 中的 customCell UITextField 在运行时 swift 不显示

ios - 最佳实践 : handling actions from buttons inside tableview cells?

iOS Swift - 在 UIImage 上画线以保存到文件

uitableview - 在 ipad 中的两个表格之间拖放

iphone - UIViewController 作为 UITableView 的数据源和委托(delegate)而不符合协议(protocol)?

iphone - 获取tableView :heightForRowAtIndexPath: to happen after tableView:cellForRowAtIndexPath:?

ios - 如何在 iOS 7 和 iOS 6 中支持不同的标签栏图标大小?

ios - 自定义类(委托(delegate)集)中未调用 textFieldShouldBeginEditing

ios - 生成随机颜色并将其分配给对象

ios - 从 Swift 中的网络调用中获取值