1、新建一个tableview继承自UITableview
- (void)layoutSubviews
{
[super layoutSubviews];
if([self.subviews count] > 2){
UIImageView *scrollViewBarImgView = [self.subviews lastObject];
UIImage *imgBar = [UIImage imageNamed:@"scoll"]; //your image here
[scrollViewBarImgView setImage:imgBar];
}else{
UIImageView *scrollViewBarImgView = [self.subviews objectAtIndex:1];
UIImage *imgBar = [UIImage imageNamed:@"scoll"]; //your image here
[scrollViewBarImgView setImage:imgBar];
}