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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T12:02:01+00:00 2026-06-04T12:02:01+00:00

I have a view in which I am doing some specific drawings in drawRect.

  • 0

I have a view in which I am doing some specific drawings in drawRect. These drawings are dynamic and are based on the view’s width and height. Then, the view which contains it applies a rotation transformation to it. However this transformation seems to adjust the values for my view’s frame which impacts my drawing in drawRect.

NSLog(@”before:%f,%f,%f,%f”,button.frame.origin.x,button.frame.origin.y,button.frame.size.width,button.frame.size.height);

    CGAffineTransform currentTransform = button.transform;
    CGAffineTransform transformRotate = CGAffineTransformMakeRotation(degreesToRadians);
    button.transform = transformRotate;

    NSLog(@"after:%f,%f,%f,%f",button.frame.origin.x,button.frame.origin.y,button.frame.size.width,button.frame.size.height);

Here is the output:

before:50.000000,100.000000,150.000000,50.000000
after:65.849365,47.548096,118.301262,154.903809

Is this correct behaviour or am I applying the transformation incorrectly?

  • 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-04T12:02:03+00:00Added an answer on June 4, 2026 at 12:02 pm

    See the reference documentation on UIView’s frame property;


    frame

    The frame rectangle, which describes the view’s location and size in
    its superview’s coordinate system.

    @property(nonatomic) CGRect frame
    

    Warning

    If the transform property is not the identity transform, the value of
    this property is undefined and therefore should be ignored.


    Despite that warning, things work as intended. Once a transformation (other that identity) is applied, the frame usually results into the projection rectangle of the original view.
    But then again, you should not ignore that warning if you really want to find out about the frame with the applied transformation and use CGRectApplyAffineTransform for properly getting it.

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

Sidebar

Related Questions

i have view controller which contains a button which show the image library ,if
So I have a view in which it has some view which has a
I have view which contains a scrollView. When the view shows up the image
I have a view which looks like this value1count value2count value3count ---------------------------------------- 25 35
I have a view which is composed of top, left and bottom headers and
I have a view which was working fine when I was joining my main
I have a view which I built in Interface builder with a tableview and
I have 5 view which have deferent json data , in all my 5
I have a view with two subviews: A UIImageView A small Custom View which
I have a Main View which call a settings panel in another view with

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.