scrollview changes as change orientation
<p>i'm creating app in which i used scrollview and insdie scrollview i used imageview to display images .But as i change the simulators orientation to landscape left/right the position of imageview and scrollview shifts towards left as the orientation increses while repeating same procedure  a stage comes where scrollview and imageview goes off to view . i used two views in a view one for portrait and other for landscape .i have to show diff. images for portrait mode and  landscpe mode so can anyone help me..thanks in advance .here is some sample code .</p>

<pre><code>- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation 
{
    if(interfaceOrientation==UIInterfaceOrientationPortrait ||interfaceOrientation==UIInterfaceOrientationPortraitUpsideDown)
    {
        return YES;
    } else if(interfaceOrientation==UIInterfaceOrientationLandscapeLeft ||interfaceOrientation==UIInterfaceOrientationLandscapeRight)   
    {
            return YES;     
    }
    return YES;
}

- (void)didRotateFromInterfaceOrientation:(UIInterfaceOrientation)fromInterfaceOrientation 
{
    UIInterfaceOrientation orientation = [[UIDevice currentDevice] orientation];

    if(orientation==UIInterfaceOrientationPortrait || orientation==UIInterfaceOrientationPortraitUpsideDown)
    {CGRect frame=CGRectMake(0,45,320,480);
        [sample_scroll_view setFrame:frame];
        sample_scroll_view.contentSize = CGSizeMake(2560,275);
        sample_scroll_view.pagingEnabled=YES;
        sample_scroll_view.autoresizingMask =
        ( UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight);
        sample_scroll_view.autoresizesSubviews = YES;
}
else if (orientation==UIInterfaceOrientationLandscapeLeft || orientation==UIInterfaceOrientationLandscapeRight)
{
CGRect frame=CGRectMake(0,45,480,275);
        [scroll_view2 setFrame:frame];
        scroll_view2.contentSize = CGSizeMake(3140,275);
        scroll_view2.maximumZoomScale = 4.0;
        scroll_view2.minimumZoomScale = 0.75;
        scroll_view2.bounces = NO;
        scroll_view2.pagingEnabled=YES;
    sample_scroll_view.autoresizingMask =
    ( UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight);
    sample_scroll_view.autoresizesSubviews = YES;
}
}
</code></pre>
