-(void) Viewdidload {
[Super Viewdidload];
[Self inittableview];
}
-(Nsinteger) Numberofsectionsintableview: (UITableView *) tableview{
return 1;
}
-(Nsinteger) TableView: (UITableView *) TableView numberofrowsinsection: (Nsinteger) section{
return 10;
}
-(UITableViewCell *) TableView: (UITableView *) TableView Cellforrowatindexpath: (Nsindexpath *) indexpath{
UITableViewCell *cell=[self TableViewZ:self.myTableView Cellforrowatindexpath:indexpath];
return cell;
}
-(UITableViewCell *) Tableviewz: (UITableView *) TableView Cellforrowatindexpath: (Nsindexpath *) indexpath{
UITableViewCell *cell=[[uitableviewcell Alloc]init];
return cell;
}
-(void) Scrollviewdidscroll: (Uiscrollview *) scrollview{
NSLog (@ "Offset---scroll:%f", self.mytableview.contentoffset.y);
Uicolor *color=[uicolor Redcolor];
CGFloat Offset=scrollview.contentoffset.y;
if (offset<0) {
Self.navigationController.navigationBar.backgroundColor = [color colorwithalphacomponent:0];
}else {
CGFloat alpha=1-((64-offset)/64);
Self.navigationcontroller.navigationbar.backgroundcolor=[color Colorwithalphacomponent:alpha];
}
}
-(void) inittableview{
self.mytableview.delegate=self;
self.mytableview.datasource=self;
}
iOS swipe tableview to change the color of the navigation bar