Image Bouncing while duing interface orientation

I am having paging in my application. Each page having Image. during the orientation i am changing the frame according to the landscape and portrait orientation. but image is bouncing. It should not bounce and want to set smoothly.

please let us know what can i do.

I am changing the frame in

- (void)willRotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation duration:(NSTimeInterval)duration

Here are some code.

 - (void)willRotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation duration:(NSTimeInterval)duration
    {
        if (toInterfaceOrientation == UIInterfaceOrientationLandscapeLeft || toInterfaceOrientation == UIInterfaceOrientationLandscapeRight)
        {
            [self performSelector:@selector(setLandscapeOrientationFrame) withObject:nil afterDelay:(duration/2)];
        }
        else
        {
            [self performSelector:@selector(setPortraitOrientationFrame) withObject:nil afterDelay:(duration/2)];
        }

    }

And in "setPortraitOrientationFrame" and "setLandscapeOrientationFrame" I am changing frame.

Answers


If you are working iOS6, you can use autolayout. The reason may be because you have used delay. If you use the code that follows, it may work.

`- (void)willRotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation duration:(NSTimeInterval)duration
 {

     if (toInterfaceOrientation == UIInterfaceOrientationLandscapeLeft || toInterfaceOrientation == UIInterfaceOrientationLandscapeRight)
     {
         [self setLandscapeOrientationFrame];
     }
     else
     {
         [self setPortraitOrientationFrame];
     }

}

Need Your Help

Order NSArray of Dictionaries - Objective c

ios objective-c arrays dictionary

I have an array of dictionaries that looks something like this

Multiple actions were found that match the request using POST method .net mvc

c# asp.net-mvc

Controller looks like the following, the get works ok, but when a post is called recieve the referenced :