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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T13:43:03+00:00 2026-06-04T13:43:03+00:00

just like the path in the picture (new users aren’t allowed to post images,

  • 0

just like the path in the picture

(new users aren’t allowed to post images, sorry i can only give the link)

http://cdn.dropmark.com/30180/3bd0f0fc6ee77c1b6f0e05e3ea14c821f8b48a82/questiong1-1.jpg

Thanks a lot for any help

  • 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-04T13:43:05+00:00Added an answer on June 4, 2026 at 1:43 pm

    Please look at my answer for this question about "rotating a label around an arbitrary point" for a more detailed explanation about using the an anchor point when rotating (ignore the keyframe animation answers since they are more complicated and not the "right tool for this job" even though the answers says so).

    In short: set the anchor point to the point (in the unit-coordinate system of your views layer) to the point outside of your view and just apply a normal rotation animation.


    EDIT: One thing to remember

    The frame of your layer (which is also the frame of your view) is calculated using the position, bounds and anchor point. Changing the anchorPoint will change where your view appears on screen. You can counter this by re-setting the frame after changing the anchor point (this will set the position for you). Otherwise you can set the position to the point you are rotating to yourself. The Layer Geometry and Transforms (linked to in the other question) also mentions this.


    The code that I provided in that answer (generalized to a UIView and Core Animation instead of UIView-animations):

    #define DEGREES_TO_RADIANS(angle) (angle/180.0*M_PI)
    
    - (void)rotateView:(UIView *)view 
           aroundPoint:(CGPoint)rotationPoint 
              duration:(NSTimeInterval)duration 
               degrees:(CGFloat)degrees {
    
        CABasicAnimation *rotationAnimation = [CABasicAnimation animationWithKeyPath:@"transform"];
        [rotationAnimation setDuration:duration];
        // Additional animation configurations here...
        
        // The anchor point is expressed in the unit coordinate
        // system ((0,0) to (1,1)) of the label. Therefore the 
        // x and y difference must be divided by the width and 
        // height of the view (divide x difference by width and 
        // y difference by height).
        CGPoint anchorPoint = CGPointMake((rotationPoint.x - CGRectGetMinX(view.frame))/CGRectGetWidth(view.bounds),
                                          (rotationPoint.y - CGRectGetMinY(view.frame))/CGRectGetHeight(view.bounds));
    
        [[view layer] setAnchorPoint:anchorPoint];
        [[view layer] setPosition:rotationPoint]; // change the position here to keep the frame
        CATransform3D rotationTransform = CATransform3DMakeRotation(DEGREES_TO_RADIANS(degrees), 0, 0, 1);
        [rotationAnimation setToValue:[NSValue valueWithCATransform3D:rotationTransform]];
        
        // Add the animation to the views layer
        [[view layer] addAnimation:rotationAnimation
                            forKey:@"rotateAroundAnchorPoint"]  
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

NSString just like 1000.00 and 1008977.72, how can I format them to 1,000.00 and
How can I authorize the users' all privileges to a path in a asp.net
Just like what happens when you click Sign in with OpenID on http://twitterfeed.com/ ,
Just like stackoverflow, there is a many-to-many relationship between Question and Tag. After running
Just like in JavaScript : opener.document.getElementByName jQuery: ?? Is there any way to get
Just like in topic I try to create a form when the elements create
Just like in this topic , I have a performance issue in dev mode
I'd just like to know, is it possible to output the processing of a
I make a call just like this: value = ./simulated_annealing Which is a C
I would just like your feedback on something. Basically I have a value called

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.