Skip to content

Latest commit

 

History

History
36 lines (25 loc) · 1.18 KB

README.md

File metadata and controls

36 lines (25 loc) · 1.18 KB

UIScrollViewIndicatorColor


Overview


**UIScrollViewIndicatorColor **, an example for how to change the color of UIScrollview scroll indicator.

Add UIScrollViewDelegate
@interface ViewController : UIViewController<UIScrollViewDelegate>
@end 
Add scrollViewDidScroll in implementation section
-(void)scrollViewDidScroll:(UIScrollView *)scrollView1
{
	//get refrence of vertical indicator
	UIImageView *verticalIndicator = ((UIImageView *)[scrollView.subviews objectAtIndex:(scrollView.subviews.count-1)]);
	//set color to vertical indicator
	[verticalIndicator setBackgroundColor:[UIColor redColor]];


	//get refrence of horizontal indicator
	UIImageView *horizontalIndicator = ((UIImageView *)[scrollView.subviews objectAtIndex:(scrollView.subviews.count-2)]);
	//set color to horizontal indicator
	[horizontalIndicator setBackgroundColor:[UIColor blueColor]];
}

Mou icon

And more?


Check StackOverflow Answer