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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T11:02:21+00:00 2026-05-25T11:02:21+00:00

I am doing a simple card rotation which works fine, but when I add

  • 0

I am doing a simple card rotation which works fine, but when I add a custom image background, after the card roation, the image is half chopped off. Any ideas?

float scaleValue = M_PI/2;

CABasicAnimation *yRotation;
yRotation = [CABasicAnimation animationWithKeyPath:@"transform.rotation.y"];
yRotation.fromValue = [NSNumber numberWithFloat:0.0];
yRotation.toValue = [NSNumber numberWithFloat:scaleValue];
yRotation.duration = .5;

CABasicAnimation *yRotation2;
yRotation2 = [CABasicAnimation animationWithKeyPath:@"transform.rotation.y"];
yRotation2.fromValue = [NSNumber numberWithFloat:scaleValue];
yRotation2.toValue = [NSNumber numberWithFloat:0.0];
yRotation2.duration = .5;
yRotation2.cumulative = YES;
yRotation2.beginTime = .5;

CAAnimationGroup *groupAnim = [CAAnimationGroup animation];
groupAnim.removedOnCompletion = NO;
groupAnim.duration = 1;
groupAnim.fillMode = kCAFillModeForwards;
groupAnim.timingFunction = [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseInEaseOut];
groupAnim.animations = [NSArray arrayWithObjects:yRotation, yRotation2, nil];

[[image objectAtIndex:num] addAnimation:groupAnim forKey:@"animateCard"];
[self.view bringSubviewToFront:[image objectAtIndex:num]];
  • 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-25T11:02:22+00:00Added an answer on May 25, 2026 at 11:02 am

    This code is help to you …….

    once try it will be perfectly working…without choppedoff

      - (void)loadView {
    [super loadView];
    self.view.backgroundColor = [UIColor blackColor];
    
    // Orbit #1
    CALayer *orbit1 = [CALayer layer];
    orbit1.bounds = CGRectMake(0, 0, 200, 200);
    orbit1.position = self.view.center;
    orbit1.cornerRadius = 100;
    orbit1.borderColor = [UIColor redColor].CGColor;
    orbit1.borderWidth = 1.5;
    
    CALayer *planet1 = [CALayer layer];
    planet1.bounds = CGRectMake(0, 0, 20, 20);
    planet1.position = CGPointMake(100, 0);
    planet1.cornerRadius = 10;
    planet1.backgroundColor = [UIColor redColor].CGColor;
    [orbit1 addSublayer:planet1];
    
    CABasicAnimation *anim1 = [CABasicAnimation animationWithKeyPath:@"transform.rotation"];
    anim1.timingFunction = [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionLinear];
    anim1.fromValue = [NSNumber numberWithFloat:0];
    anim1.toValue = [NSNumber numberWithFloat:((360*M_PI)/180)];
    anim1.repeatCount = HUGE_VALF;
    anim1.duration = 8.0;
    [orbit1 addAnimation:anim1 forKey:@"transform"];
    
    [self.view.layer addSublayer:orbit1];
    
    // Orbit #2
    CALayer *orbit2 = [CALayer layer];
    orbit2.bounds = CGRectMake(0, 0, 120, 120);
    orbit2.position = planet1.position;
    orbit2.cornerRadius = 60;
    orbit2.borderColor = [UIColor blueColor].CGColor;
    orbit2.borderWidth = 1.5;
    
    CALayer *planet2 = [CALayer layer];
    planet2.bounds = CGRectMake(0, 0, 16, 16);
    planet2.position = CGPointMake(60, 0);
    planet2.cornerRadius = 8;
    planet2.backgroundColor = [UIColor blueColor].CGColor;
    [orbit2 addSublayer:planet2];
    
    CABasicAnimation *anim2 = [CABasicAnimation animationWithKeyPath:@"transform.rotation"];
    anim2.timingFunction = [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionLinear];
    anim2.fromValue = [NSNumber numberWithFloat:0];
    anim2.toValue = [NSNumber numberWithFloat:((360*M_PI)/180)];
    anim2.repeatCount = HUGE_VALF;
    anim2.duration = 4.0;
    [orbit2 addAnimation:anim2 forKey:@"transform"];
    
    [orbit1 addSublayer:orbit2];
    
    // Orbit #3
    CALayer *orbit3 = [CALayer layer];
    orbit3.bounds = CGRectMake(0, 0, 72, 72);
    orbit3.position = planet2.position;
    orbit3.cornerRadius = 36;
    orbit3.borderColor = [UIColor grayColor].CGColor;
    orbit3.borderWidth = 1.5;
    
    CALayer *planet3 = [CALayer layer];
    planet3.bounds = CGRectMake(0, 0, 12, 12);
    planet3.position = CGPointMake(36, 0);
    planet3.cornerRadius = 6;
    planet3.backgroundColor = [UIColor grayColor].CGColor;
    [orbit3 addSublayer:planet3];
    
    CABasicAnimation *anim3 = [CABasicAnimation animationWithKeyPath:@"transform.rotation"];
    anim3.timingFunction = [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionLinear];
    anim3.fromValue = [NSNumber numberWithFloat:0];
    anim3.toValue = [NSNumber numberWithFloat:((360*M_PI)/180)];
    anim3.repeatCount = HUGE_VALF;
    anim3.duration = 2.0;
    [orbit3 addAnimation:anim3 forKey:@"transform"];
    
    [orbit2 addSublayer:orbit3];
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

In My iphone Application,I am doing simple image animation in a View and in
Doing a simple Squeryl database lookup, but trying to exclude a value. I've tried:
I'm doing simple voice recording application. In my application, after the voice recording the
I'm doing simple GUI updates on a timer. Which method is better to use
I have a jQuery UI which is doing simple autocomplete function. Autocomplete is coming
I'm doing simple string input parsing and I am in need of a string
I am doing simple forms authentication for a small ASP.NET (3.5, C#) application and
I've been doing simple multi-threading in VB.NET for a while, and have just gotten
I'm doing simple divisions in c#, and I am a bit puzzled by its
What's the easiest way of doing simple pattern matching a la .something.com something.com/ something.com/somefolder/*.jpg

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.