bTagTiger
bTagTiger

Reputation: 1321

Can I horizontal filp the UIButton?

I've some problem with UIButton.

In my case I have to flip the button horizontally.

I tried it's width to minus value. But it doesn't work.

How can I do this?

Upvotes: 1

Views: 624

Answers (2)

nekno
nekno

Reputation: 19267

If you want it to rotate 360 degrees horizontally:

[UIView beginAnimations:nil context:nil];
[UIView setAnimationDuration:0.75]; // transition speed

[UIView setAnimationTransition:UIViewAnimationTransitionFlipFromRight forView:self.YourButton cache:NO];

[UIView commitAnimations];

Upvotes: 3

Cyrille
Cyrille

Reputation: 25144

Simply set its transform to CGAffineTransformMakeScale(-1.0, 1.0).

Upvotes: 4

Related Questions