I have a scrollView with 4 page; I want to change it's background color at every page; then I want to know index page value. For example, if I have page 1, I want to know that I have index 1 then background must be red or if I have page 3, I want to know that I have index 3 and background color must be blue.
then I want to do an "if" where I control if my current page have index 1, or index 2, or index 3.....
The page index is found by: scrollview.contentOffset.x / scrollview.frame.size.width
.
To set the background color you can either:
There is problem with option one. When transitioning between pages the background colour will be incorrect until the scrolling ends.