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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T19:38:53+00:00 2026-05-22T19:38:53+00:00

I have a UIView that I rotate with this code: helpView.transform = CGAffineTransformMakeRotation(degreesToRadians( rotationAngle

  • 0

I have a UIView that I rotate with this code:

helpView.transform = CGAffineTransformMakeRotation(degreesToRadians( rotationAngle ));

Where degreeToRadians just is a macro to convert from degrees to radians.

This works fine as long as the view is visible, eg alpha = 1. When I hide it (alpha = 0, which I animate) it does not rotate any more. I guess this is a smart way for the devices to “save” on drawing time, but is there any way I can force it to be drawn even when alpha is 0? Otherwise I will have to rotate it before I show it again.

Any good ideas?

Thanks

Edit: This is the code I use to show/hide the view.

-(void)showHelp
{
    bool helpAlpha = !helpView.alpha;
    CGFloat newScale;

    if (helpView.alpha) {
        newScale = kHelpSmall;
        helpView.transform = CGAffineTransformMakeScale(kHelpBig, kHelpBig);
    } else {
        newScale = kHelpBig;
        helpView.transform = CGAffineTransformMakeScale(kHelpSmall, kHelpSmall);
    }

    [UIView animateWithDuration:(kAnimationTimeShort / 2) animations:^(void) {
        [helpView setAlpha:helpAlpha];
        helpView.transform = CGAffineTransformMakeScale(newScale, newScale);
    }];
}

As you see I also scale it for a nicer effect. Works perfect when visible, does not rotate when alpha = 0. Rotation is done in another method, where I would prefer to keep it as I also rotate some other views there.

  • 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-22T19:38:54+00:00Added an answer on May 22, 2026 at 7:38 pm

    You are resetting the transform every time you use CGAffineTransformMake*. If you do this, you will get either a rotated transform or a scaled one. I am assuming the scaled one is after the rotated one and hence you aren’t able to see the view rotated. If you need both the effects to remain, you will have to use CGAffineTransformRotate. So a scale and rotate will be

    helpView.transform = CGAffineTransformMakeScale(kHelpSmall, kHelpSmall);
    helpView.transform = CGAffineTransformRotate(helpView.transform, degreesToRadians(rotationAngle));
    

    The order might vary.

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

Sidebar

Related Questions

I have a UIViewController, a switcher that will basically just rotate a view from
I have this UIView that I subclassed and implemented my own drawRect method. When
I have an UIView that is used for overlaying a cameraPicker. Into this View,
I have to write some code for a UIView that will contain a set
I have a UIView object that rotates using CALayer 's transform: // Create uiview
I have a UIView that I'm sliding in using a UIScrollView. Code looks like
I have a UIView that will eventually contain about 2 screens worth of information.
I have a UIView that has several UIImageViews as subviews. Each of these subviews
I have a UIView that contains a number of CALayer subclasses. I am using
I have a UIView that contains a UIScrollView and I want to be able

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.