PushListView.h@interfacepushlistview:uiview<uitableviewdelegate,uitableviewdatasource{cgfloat contentoffsety; CGFloat oldcontentoffsety; CGFloat newcontentoffsety;} ............................... PUSHLISTVIEW.M//start dragging the view- (void) Scrollviewwillbegindragging: (Uiscrollview *) scrollview{contentoffsety=Scrollview.contentoffset.y;} //call this method when scrolling (after the finger leaves the screen)- (void) Scrollviewdidscroll: (Uiscrollview *) scrollview{//NSLog (@ "scrollview.contentoffset:%f,%f", Scrollview.contentoffset.x, Scrollview.contentoffset.y);newcontentoffsety=Scrollview.contentoffset.y; if(Newcontentoffsety > Oldcontentoffsety && oldcontentoffsety > Contentoffsety) {//Scroll upNSLog (@" up"); } Else if(Newcontentoffsety < oldcontentoffsety && Oldcontentoffsety < contentoffsety) {//Scroll downNSLog (@" Down"); } Else{NSLog (@"dragging"); } if(scrollview.dragging) {//draggingNSLog (@"scrollview.dragging"); NSLog (@"contentoffsety:%f", contentoffsety); NSLog (@"newcontentoffsety:%f", SCROLLVIEW.CONTENTOFFSET.Y); if((scrollview.contentoffset.y-contentoffsety) >5.0f) {//drag up//hide the navigation bar and options Bar//[self layoutview];[_viewcontroller.navigationcontroller Setnavigationbarhidden:yes Animated:yes]; //[_viewcontroller.navigationcontroller Settoolbarhidden:!hidden animated:yes];_viewcontroller.tabbarcontroller.tabbar.hidden=YES; } Else if((CONTENTOFFSETY-SCROLLVIEW.CONTENTOFFSET.Y) >5.0f) {//drag down//Show navigation bar and options Bar//[self layoutview];[_viewcontroller.navigationcontroller setnavigationbarhidden:no Animated:yes]; //[_viewcontroller.navigationcontroller settoolbarhidden:no animated:yes];_viewcontroller.tabbarcontroller.tabbar.hidden=NO; } Else { } }}//Complete the drag (call this method when scrolling stops, before the finger leaves the screen)- (void) Scrollviewdidenddragging: (Uiscrollview *) ScrollView willdecelerate: (BOOL) decelerate{//NSLog (@ "scrollviewdidenddragging");oldcontentoffsety=Scrollview.contentoffset.y;}
This is scorllview inside the method of judging the direction of the slide in the corresponding method to add hidden TabBar method can be.
TabBar pull-up hidden, pull-up display implementation