I\'m using a horizontal UIScrollView, and I want a background color transition depending on the x value of the content offset.
Example: The width o
In your scrollView delegate try something like this:
-(void)scrollViewDidScroll:(UIScrollView *)scrollView{
CGPoint a = self.mainScrollView.contentOffset;
if(a.x >= 320){
[UIView animateWithDuration:0.5 animations:^{
[self.view setBackgroundColor:[UIColor redColor]];
}];
}
else{
[UIView animateWithDuration:0.5 animations:^{
[self.view setBackgroundColor:[UIColor yellowColor]];
}];
}
}