Here it is a problem in your code. Why you are setting the frame size like this?? You have only the screen size of 320px width
. And when it changes to landscape
, height will be only 320px
. But you are setting the scroll height
as 480px
and it goes out of the screen
and start to scroll diagonally
.
self.scroll.frame = CGRectMake(0,0,480,480);
Instead of that frame size, change like this
self.scroll.frame = CGRectMake(0,0,480,320);
And you need to set the content size depend on the content you are having inside the scroll view in either orientation.