objective c - TableView Header like iOS 7 Mail and Messages App -
edit: think narrowing down issue here. found easier way recreate want. if create new project storyboard, drag on tableview controller , drag on search bar subview of tableview. if run (with dummy cells), , scroll half of search bar showing, search bar snap top of view. if try dragging on uiview instead of search bar, behavior no longer happens. how can behavior uiview subview?
hopefully made more clear, guys.
i have header in plain style table view, implementing this:
-(cgfloat)tableview:(uitableview *)tableview heightforheaderinsection:(nsinteger)section{ return 51; } - (uiview *)tableview:(uitableview *)tableview viewforheaderinsection:(nsinteger)section { segmentedheaderview *header = [[segmentedheaderview alloc]initwithframe:cgrectmake(0, 0, 320, 51)]; return header; } - (void)scrollviewdidscroll:(uiscrollview *)scrollview { cgfloat sectionheaderheight = 51; if (scrollview.contentoffset.y<=sectionheaderheight&&scrollview.contentoffset.y>=0) { scrollview.contentinset = uiedgeinsetsmake(-scrollview.contentoffset.y, 0, 0, 0); } else if (scrollview.contentoffset.y>=sectionheaderheight) { scrollview.contentinset = uiedgeinsetsmake(-sectionheaderheight, 0, 0, 0); } }
i want header scroll tableview , not stick top, , correctly. however, when scroll top, want header work search bar header in messages app in ios 7. in messages app, when scrolling , stop halfway through search bar, either search bar sticks top of view, or first cell sticks top of view.
how can implement when user stops scrolling part of header view showing header jumps up?
edit: behavior want can seen search bar in mail app.
Comments
Post a Comment