Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7405547
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T05:25:12+00:00 2026-05-29T05:25:12+00:00

I am having a weird error while animating a couple of view in iOS.

  • 0

I am having a weird error while animating a couple of view in iOS. My goal is to switch from a custom “Split View”. You can see what’s going on in this youtube video: http://youtu.be/ZWbf2bQYMns

You can see the weird “bump” in the Y value of the UIImageView, and I have been wondering how to fix it for quite a while now.

This is the View Controller’s interface:

@interface VideoSharing_Pad : UIViewController
{   
    IBOutlet UIView *videoCallView;
    IBOutlet UIImageView *imageView;  //This is "inside" mediaView
    IBOutlet UIView *mediaView;
    CGRect mediaRect;
    CGRect videoCallRect;
    CGRect imageRect;
}

In viewDidLoad I store both views doing:

//Get frames from XIB
mediaRect = mediaView.frame;
videoCallRect = videoCallView.frame;
imageRect = imageView.frame;

And this is the code that executes when I want to switch from the Split View to a full Screen Mode:

- (IBAction)toggleFullScreen:(id)sender 
{
    if (iScreenMode == callAndShareMedia) {
        CGRect fullScreenRect = CGRectMake(0, 0, 1024, 768);
        CGRect dissapearRect = CGRectMake(0, - videoCallView.bounds.size.height, videoCallView.bounds.size.width, videoCallView.bounds.size.height);

        [UIView animateWithDuration:1.0
                              delay:0.1
                            options: UIViewAnimationCurveEaseOut
                         animations:^{

                             [videoCallView setFrame:dissapearRect];
                             [imageView setFrame:fullScreenRect];
                             [mediaView setFrame:fullScreenRect];
                         } 
                         completion:^(BOOL finished){

                         }];

        iScreenMode = onlyShareMedia;
        return;
    } 
    else if (iScreenMode == onlyShareMedia)
    {

        [UIView animateWithDuration:1.0
                              delay:0.1
                            options: UIViewAnimationCurveEaseOut
                         animations:^{

                             [videoCallView setFrame:videoCallRect];
                             [mediaView setFrame:mediaRect];
                             [imageView setFrame:imageRect];  

                         } 
                         completion:^(BOOL finished){    
                         }];
        iScreenMode = callAndShareMedia;
        return;
    }     
}

I would really appreciate any help I can get. Thanks a lot!

this is a screenshot of the XIB:

enter image description here

as you can see from the screenshot and the .h file, the imageView is inside an UIView called mediaView, The other UIView, videoCallView is the one with the three dummy pictures.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-29T05:25:12+00:00Added an answer on May 29, 2026 at 5:25 am

    Interesting question indeed. It definitely has to do with animating superview and subview at the same time. I did sample program, and reproduced similar situation.

    My workaround would be to avoid animating the superview (mediaView), and expand only the subview (imageView) to full rectangle. Since your superview (mediaView) does not have much, it should not give so different user experience.

    So, instead of

    [UIView animateWithDuration:1.0
                          delay:0.1
                        options: UIViewAnimationOptionCurveEaseOut
                     animations:^{
                         [videoCallView setFrame:dissapearRect];
                         [imageView setFrame:fullScreenRect];
                         [mediaView setFrame:fullScreenRect];
     }];
    

    You can do

    [UIView animateWithDuration:1.0
                          delay:0.1
                        options: UIViewAnimationOptionCurveEaseOut
                     animations:^{
                         [videoCallView setFrame:dissapearRect];
                         [imageView setFrame:(CGRect){fullScreenRect.origin.x - mediaRect.origin.x, fullScreenRect.origin.y - mediaRect.origin.y, fullScreenRect.size}];
     }];
    

    For coming back to normal mode, you can just ignore mediaView animation. Probably you want to move (animate) the toggleButton along with other animation as well.

    @jrturton’s answer (second part) seemed a nice workaround, but it did not work on my sample code. It worked on the way to go (expansion), but bumped on the way back (shrink), for the reason I don’t know why. But don’t dismiss his answer because of my comment, it could be me.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm having a weird error in Rails, I'm making an app where users can
I'm having a weird error. During user creation, if a username already exists in
I'm having a weird issue with a function I'm trying to call from within
I'm having a weird error with Internet Explorer (Currently version 8, but had the
i m having a really weird error: i am using buffered reader (br) and
Using Visual Studio 10 C++, I'm having weird link error. For some reason references
I'm having a weird problem with Restkit+iOS 5 + Rails: when I attempt to
I'm having a weird error with some Google App Engine code I'm writing. My
I am having a weird problem that I hope you can help me with.
I am having a weird error when using Omniauth. This appears to have little

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.