Forgive me the crooked title, because I am unsure of how this description of this question is.
Recently many iOS apps use a scrolling UI design pattern that helps screen maximize real-estate, usually when the user scrolls downwards when the header hides. For example, in the main view of the Instragram, there is an Instagram header at the top, this header maintains the header at the top of the scrolling top, and the view normally bounces on the upper part of the material. But scroll down and the header works as part of the content, making the path for 44 digits in addition to the vertical position.
It probably is that I have not done too much iOS work in a while, but I can not easily figure out how best to impliment this? Apologies for terrible details.
Header does not matter, use a different view at the top About scroll view In case you use UITableView, you can use section headers.
Edit Use this code: (Believers that _headerView is the header, sitting on the top of the scroll view, not inside it. In addition, both scroll view and header start at the top of their original view , Y == 0. Additionally, your view controller should be installed as a representative of the scroll view ) I have just written this code from memory; It has not tested it, but for most it requires only the skining.
- (zero) scrollviewdcroll: (UIScrollView *) ScrollView {CGPoint offset = scrollView.contentOffset ; CAGRT headerfam = _headerview.fr; If (offset. Y> 0) {headerFrame.origin.y = offset.y; } And {headerFrame.origin.y = 0.0; } [_headerView setframe: headerframe]; }
Comments
Post a Comment