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

  • Home
  • SEARCH
  • 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 8786695
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T21:42:12+00:00 2026-06-13T21:42:12+00:00

I am attempting to scale my UIView at the same time as I fade

  • 0

I am attempting to scale my UIView at the same time as I fade in a shadow, using the following:

    myController.view.layer.shadowOffset = CGSizeMake(0, 3);
    myController.view.layer.shadowColor = [UIColor blackColor].CGColor;
    myController.view.layer.shadowOpacity = 0.0;
    myController.view.layer.shadowPath = [UIBezierPath bezierPathWithRect:myController.view.bounds].CGPath;

    [UIView animateWithDuration:0.3
                     animations:^{
                         //shrink the view
                         myController.view.transform = CGAffineTransformMakeScale(0.8, 0.8);

                         //fade in the shadow
                         myController.view.layer.shadowOpacity = 0.8;
                     }
                     completion:^(BOOL finished){
                          ...etc

The view resizes correctly but the shadow appears immediately instead of fading in.

Am I doing something wrong? I thought the shadowOpacity was animatable?

  • 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-06-13T21:42:14+00:00Added an answer on June 13, 2026 at 9:42 pm

    You have to use Core Animations to animate a views layer property:

    #import <QuartzCore/CAAnimation.h>
    
    CABasicAnimation *animation = [CABasicAnimation animationWithKeyPath:@"shadowOpacity"];
    animation.fromValue = [NSNumber numberWithFloat:1.0];
    animation.toValue = [NSNumber numberWithFloat:0.8];
    animation.duration = 1.0;
    [myView.layer addAnimation:animation forKey:@"shadowOpacity"];
    myView.layer.shadowOpacity = 0.0;
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am attempting to make a full scale game for the first time and
I am attempting to extract Weibull distribution parameters (shape 'k' and scale 'lambda') that
I am attempting to manipulate a DOM tree using lxml 's etree module. One
i'm attempting to maximize the scale of an image so that it uses as
I'm attempting to scale an image, modify it, and then output to another image
i'm attempting (so far unsuccessfully) to programatically increase and decrease the scale of an
I'm attempting to use JQuery to create a dynamic page header using an image
Using Visual Studio 2010 and I'm encountering an error when attempting to use the
I'm attempting to flip a button on a form using a storyboard. What I
ATTEMPTING: I am trying to load a FLV using the FLVPlayback() component in another

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.