2015-09-16 20 views
0

我想增加滾動條的寬度並添加一個圓形滾動條。我應該使用一個圖像的圓圈?我沒有看到的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]; 
+0

你不能改變滾動條的寬度。您只能將自定義視圖添加到滾動條的一側。 –

+1

你可以看到這個例子添加一個自定義視圖到滾動條。 :http://stackoverflow.com/questions/32460973/uiview-that-follows-uicollectionview-indicator/32462201#32462201 –

+0

@ Mr.T我可以增加自定義視圖滾動條的寬度? – user580950

回答