make transparent stickyHeader like weather iOS

非 Y 不嫁゛ 提交于 2019-12-11 01:37:56

问题


i want to create transparent sticky header like weather app in iOS as my header is transparent view goes under header but i don't want other content visible bellow my header. ( you can see "Friday" goes under header and will hidden but the header is transparent). you can check the animation and this behavior in weather app.

i have tried :

CSStickyHeader


回答1:


This is done with a combination of various scroll views and table views.

It looks like the whole screen is contained in a UIScrollView. The "header" is just a UILabel that moves depending on the content offset of the scroll view.

The time bar with "Now", "02", "03", ... Is probably a UICollectionView inside the main UIScrollView.

The section underneath that is a UITableView with all the day information. This is also embedded inside the UIScrollView.

The scrolling is then managed by the main UIScrollView and passed down to the UITableView.

However, when the tableview scrolls it is not going underneath anything. The content is being cut off because that is the top of the UITableView.

Then the entire thing is also embedded inside a UIPageViewController to manage the pages.

Something like this...



来源:https://stackoverflow.com/questions/33010199/make-transparent-stickyheader-like-weather-ios

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!