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 6784021
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T16:56:24+00:00 2026-05-26T16:56:24+00:00

I have two imageViews that I call firstView and secondView; I have to do

  • 0

I have two imageViews that I call firstView and secondView; I have to do an animation that move a third imageView that I call imageView3. This imageView3 is inside firstView and I do this code

[UIView beginAnimations:nil context:NULL];
[UIView setAnimationDuration:0.5];
[imageView3 setFrame:frameinSecondView];
[UIView commitAnimations];
//[imageView3 removeFromSuperview];
//[secondView addSubview:imageView3];

with this code I can move imageView3 to secondView but the problem is that I’m not able to set imageView3 in the correct frame “frameinSeconView”; instead if I use the commented code

[imageToMove removeFromSuperview];
[scrollViewAlfabeto addSubview:imageToMove];

imageView3 go on the correct frame but I don’t see the animation because when it starts its animation, imageview3 disappear from firstView ad appear when it go on secondView

How Can I solve to have a correct animation, with a correct frame between these two imageViews.

  • 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-26T16:56:25+00:00Added an answer on May 26, 2026 at 4:56 pm

    You are trying to pass imageView3 from 1 to 2 right?
    Remove it from imageView1 and place it on the windowView, do the animation from 1 to 2 and wait to end the animations to remove from windowView and insert into imageView2

    how to wait? … well there is a [sentence something] structure that do that, but i dont know how is it, instead of that (cause ive never found how) i started to use “animation blocks” 😀

    what is an animation block?
    block: object that means an action;
    below is an example of an animation using block objects block1, block2 (CODE PARTC)

        [UIView animateWithDuration:2 delay:0 
                        options:UIViewAnimationCurveEaseIn 
                     animations: block1
                     completion: block2
        ];
    

    It means that it will do actions defined in block1, as if they were inside begin-commit animation sentences, and (the beautiful part) after its COMPLETION they will do the actions in block2! :D!

    but what is a f—-ng block?; well…
    THIS IS A F—-NG BLOCK!:

    Block that returns void (CODE PARTA):

        void (^block1)(void) = ^{
        centerPortrait.frame = frame1;
        if (lookingMenu==NO)
            listTableView.frame = frameT1;
        };
    

    Block that returns BOOL (after completion: you need a bool) and that have another animation inside (CODE PARTB)

        void (^block2)(BOOL) = ^(BOOL got){
        [UIView animateWithDuration:halfDuration delay:0 
                            options:UIViewAnimationCurveEaseIn 
                         animations:^{
                             centerPortrait.image = image;
                             centerPortrait.frame = frame2;
                             if (lookingMenu==YES)
                                 listTableView.frame = frameT2;
                         } 
                         completion:nil
         ];
        };
    

    I’ve used this to make a fake rotation of an image hohohoho
    Anyways if u didnt got it, the order is PARTA,B,C 😛

    Read this:
    http://developer.apple.com/library/ios/#documentation/cocoa/Conceptual/Blocks/Articles/bxGettingStarted.html%23//apple_ref/doc/uid/TP40007502-CH7-SW1

    is where i got how to use blocks :D, and heres an useful tutorial of the great RAYWENDERLICH:
    http://www.raywenderlich.com/2454/how-to-use-uiview-animation-tutorial

    Hope it helps!

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

Sidebar

Related Questions

I have a layout with two ImageView inside. Each image has a fixed aspect
I have two applications written in Java that communicate with each other using XML
I have a listlayout with items in it that looks like this: There is
I am creating an app, in which I have two small imageview (using have
I have some code that creates a popup and assign it an XML layout
I have an ImageView that you can use to do a one-finger pan, or
I have a Canvas that i draw text on. (this is quite advanced i
If I have a layout with two ImageViews. Their id's are image_one and image_two.
I have two ImageView s, one TextView and one Gallery in my app and
I have a Cocoa app I'm writing that has an ImageView with a TextView

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.