更改宽度并将圆形滚动条添加到UIScrollView

时间:2015-09-16 13:20:13

标签: ios objective-c uiscrollview

我正在尝试增加滚动条的宽度并添加一个圆形滚动条。我要用圆圈的图像吗?我没有看到任何UIScrollView的属性或方法来更改滚动条的宽度

enter image description here

我尝试了以下内容:

UIScrollView *myScroll = [[UIScrollView alloc] init];
myScroll.frame = self.view.bounds; //scroll view occupies full parent view!
//specify CGRect bounds in place of self.view.bounds to make it as a portion of parent view!

myScroll.contentSize = CGSizeMake(400, 800);   //scroll view size

myScroll.backgroundColor = [UIColor grayColor];

myScroll.showsVerticalScrollIndicator = YES;    // to hide scroll indicators!

myScroll.showsHorizontalScrollIndicator = YES; //by default, it shows!

myScroll.scrollEnabled = YES;                 //say "NO" to disable scroll

[myScroll setBackgroundColor:[UIColor redColor]];
myScroll.indicatorStyle = UIScrollViewIndicatorStyleWhite;

[self.view addSubview:myScroll];

1 个答案:

答案 0 :(得分:0)

此自定义ScrollView解决了我的所有问题https://github.com/BasheerSience/BRScrollBar