Because the project needs can not let section in the Kinsoku view sliding, gu according to some information on the internet and their own arrangement of ideas, has achieved no sliding effect, on the code, what all said, engaged for 2 hours are tears ....
1. Create a TableView
_maintableview = [[UITableView alloc]initwithframe:cgrectmake (0,0, Kscreenwidth, Kscreenheight- -) Style:uitableviewstyleplain];//with navigation bar -64_maintableview.backgroundcolor =[Uicolor Clearcolor];_maintableview.datasource=Self;_maintableview.Delegate=Self;_maintableview.sectionheaderheight= +;//Headview High_maintableview.sectionfooterheight = -;//Footerview High_maintableview.contentinset = Uiedgeinsetsmake (0,0, - -,0);//need a bottom view when loading
2. Implement ScrollView Proxy Protocol
- (void) Scrollviewdidscroll: (Uiscrollview *) scrollview{cgfloat sectionheaderheight= -;//set maximum values for Headview and Footerview if(scrollview.contentoffset.y<=sectionheaderheight&&scrollview.contentoffset.y>=0) {//Headerview just started the slideScrollview.contentinset = Uiedgeinsetsmake (-scrollview.contentoffset.y,0,-sectionheaderheight,0); } Else if(Scrollview.contentoffset.y>=sectionheaderheight && Scrollview.contentoffset.y + -< Scrollview.contentsize.height-scrollview.frame.size.height) {//sliding in the middleScrollview.contentinset = Uiedgeinsetsmake (-sectionheaderheight,0,-sectionheaderheight,0); }Else if(Scrollview.contentoffset.y + ->= scrollview.contentsize.height-scrollview.frame.size.height && Scrollview.contentoffset.y < Scrollview.contentsize.height-scrollview.frame.size.height) {//Footerview at the end of the slideScrollview.contentinset = Uiedgeinsetsmake (0,0,-(SCROLLVIEW.CONTENTSIZE.HEIGHT-SCROLLVIEW.FRAME.SIZE.HEIGHT-SCROLLVIEW.CONTENTOFFSET.Y),0); }}
IOS tabeview head View and tail view do not slide the implementation