自定义tableview 滚动条

2016-09-13  本文已影响145人  火星的蝈蝈

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];

}

上一篇 下一篇

猜你喜欢

热点阅读