Skip to content

developerinsider/UIScrollViewIndicatorColor

Repository files navigation

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

About

Change the color of UIScrollview's scroll indicator.

Resources

Security policy

Stars

Watchers

Forks

Releases

No releases published

Sponsor this project

 

Packages

No packages published