rotating UIbutton, while rotating parentview they reside with in
NickName:Huang Ask DateTime:2013-02-10T10:38:39

rotating UIbutton, while rotating parentview they reside with in

I have one UIView that I rotate manually when orientation changes, this UIView hosts a number of buttons, I want to rotate them too based on the change in orientation.

I am doing this :

  CGAffineTransform rotation = CGAffineTransformMakeRotation(M_PI / -4);

    [UIView animateWithDuration:0.25 animations:^
    {

        self.parentView.firstButton.transform =   CGAffineTransformConcat(self.parentView.firstButton.transform, rotation);
        self.parentView.secondButton.transform = CGAffineTransformConcat(self.parentView.secondButton.transform, rotation);
        self.parentView.thirdButton.transform = CGAffineTransformConcat(self.parentView.thirdButton.transform, rotation);
        self.parentView.transform = CGAffineTransformConcat(self.parentView.transform, rotation);
    }
        completion:^(BOOL finished)
    {
    }];

parentView does rotate properly, but the other buttons do not !! do I need to perform the rotation in another call? as in I cannot rotate a button and its parentview in the same block?

Thanks

Copyright Notice:Content Author:「Huang」,Reproduced under the CC 4.0 BY-SA copyright license with a link to the original source and this disclaimer.
Link to original article:https://stackoverflow.com/questions/14794122/rotating-uibutton-while-rotating-parentview-they-reside-with-in

More about “rotating UIbutton, while rotating parentview they reside with in” related questions

rotating UIbutton, while rotating parentview they reside with in

I have one UIView that I rotate manually when orientation changes, this UIView hosts a number of buttons, I want to rotate them too based on the change in orientation. I am doing this :

Show Detail

iOS - Rotating objects using core animation and longpress UIButton

So, I created a simple app when the user press a long press on the button it rotates the CALayer, and when the user remove his hands from the button the CALayer speed is set to 0 so the CALayer sto...

Show Detail

Rotating images in JavaScript

Should be an easy question for someone who knows JS. I have a webpage with in the footer 4 images that are rotating. <div class="column_w190 fl margin_right_40"> <!-- START: Rotating

Show Detail

Rotating wheel in Swing

I have searched here but did not get my answer (though I feel it should be here). I want to perform some activity(but I don't know how much time it will take to complete) and while this task is be...

Show Detail

Animating width and height in rotating cube

I have a rotating cube rotating with this CSS3 animation: @-webkit-keyframes rotating { from { -webkit-transform: rotateX(0deg) rotateY(0deg); } to { -webkit-transform: rotateX(360deg) rot...

Show Detail

CGAffineTransform revert the rotating direction

I'm rotating 360º a UIButton using this code: self.btn.transform = CGAffineTransform(rotationAngle: (180.0 * CGFloat(M_PI)) / 180.0) self.btn.transform = CGAffineTransform(rotationAngle: (0.0 *

Show Detail

Touch position on rotating Sprite

i have a simple ball in SpriteKit which is rotating Lets say i touch the ball on the far right edge several times while it is rotating. The sprite coordinates are different each time because of the

Show Detail

Path inside svg is not rotating correctly

I want to make a simple effect with an svg path rotating inside another path. The code is as simple as: #lens { animation: roll 2s infinite; } @keyframes roll { 0% {transform:

Show Detail

How to implement a rotating control on Android?

Does anyone have any ideas on how to create a rotating control? Something that looks like this: http://www.raywenderlich.com/9864/how-to-create-a-rotating-wheel-control-with-uikit I came across 2 ...

Show Detail

How to implement a rotating control on Android?

Does anyone have any ideas on how to create a rotating control? Something that looks like this: http://www.raywenderlich.com/9864/how-to-create-a-rotating-wheel-control-with-uikit I came across 2 ...

Show Detail