-(void) Scrollviewdidscroll: (Uiscrollview *) ScrollView
{
[Self.navigationController.navigationBar setbackgroundimage:[self Imagewithbgcolor:[uicolor colorwithred: self.tableview.contentoffset.y/255 green:255/255 blue:255/255 Alpha:1]] forbarmetrics:uibarmetricsdefault];
NSLog (@ "contentoffset====%f", SELF.TABLEVIEW.CONTENTOFFSET.Y);
if (Self.tableview.contentoffset.y < 0) {
Self. Myview. Hidden = YES;
}
}
-(UIImage *) Imagewithbgcolor: (Uicolor *) Color {
CGRect rect = CGRectMake (0.0f, 0.0f, 1.0f, 1.0f);
Uigraphicsbeginimagecontext (rect.size);
Cgcontextref context = Uigraphicsgetcurrentcontext ();
Cgcontextsetfillcolorwithcolor (context, [color Cgcolor]);
Cgcontextfillrect (context, rect);
UIImage *image = Uigraphicsgetimagefromcurrentimagecontext ();
Uigraphicsendimagecontext ();
return image;
}
iOS swipe tableview to change the color of the navigation bar-1