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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T01:35:16+00:00 2026-05-18T01:35:16+00:00

I have an animation that lifts up a button and drops a shadow. Here’s

  • 0

I have an animation that “lifts” up a button and drops a shadow. Here’s how I do it, for example.

button1shadow.alpha = 0;
button1shadow.hidden = NO;
[UIView beginAnimations:nil context:NULL];
[UIView setAnimationDuration:1.5];
CGRect frame11 =searchByName.frame;
frame11.origin.y -=20;
frame11.origin.x +=20;
searchByName.frame = frame11;
searchByNameLabel.frame = frame11;
CGRect frame21 = button1shadow.frame;
frame21.origin.y +=10;
frame21.origin.x -=10;
button1shadow.frame = frame21;
searchByName.alpha      = 1;
button1shadow.alpha     = 0.1;
[UIView commitAnimations]; 

This works just fine if I run it by itself.

Then I put this code right after the code above.

button1shadow.hidden = NO;
[UIView beginAnimations:nil context:NULL];
[UIView setAnimationDelay:2.0];
[UIView setAnimationDuration:1.5];
CGRect frame11 =searchByName.frame;
frame11.origin.y +=20;
frame11.origin.x -=20;
searchByName.frame = frame11;
searchByNameLabel.frame = frame11;
CGRect frame21 = button1shadow.frame;
frame21.origin.y -=10;
frame21.origin.x +=10;
button1shadow.frame = frame21;
searchByName.alpha      = 1;
button1shadow.alpha     = 0.1;
[UIView commitAnimations]; 

Both work fine seperately, but when I combine them right after each other the first animation is not displayed, but the button jumps up to the coordinates I assigned instead of animating. Any ideas?

Edit:
I also tried to call the second animation by using:

[NSTimer timerWithTimeInterval:2.0 target:self selector:@selector(lowerButtons) userInfo:nil repeats:NO];

However, it didn’t seem to even call “lowerButtons”.

  • 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-18T01:35:17+00:00Added an answer on May 18, 2026 at 1:35 am

    You’re setting an animation delay, so this should work, but have you tried doing the second animation in a delegate callback? Check out UIView’s +setAnimationDelegate: and +setAnimationDidStopSelector: methods.

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

Sidebar

Related Questions

I have an animation on a partially hidden div container that will execute when
So I have an animation that is being created by having a bunch of
I have created a jQuery animation that can be seen by clicking the Preview
I have what I thought was a relatively easy Ajax/animation that I'm adding to
I have a UIImageView object that when clicked it will play a animation, I
I have this complicated slider that utilizes tons of animation. I'm trying to find
I have a UIImageView that is displaying a series of pictures as an animation.
I have an ImageView that is 250dp above the bottom and with translate animation
As titled, how can I do that? I have been reading some Silverlight/WPF animation
It's strange. I have an animation that start when i .hover on a DIV.

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.