I\'m using a vertical UIButton in a portrait app (Just a normal button that is of width 60 and Height 160)
I want to put the label Vetically down the button instead of a
I know this is an old thread, but another way to do this is to subclass the button and specify a square size for the button label.
@interface RotatingButton : UIButton
@end
@implementation RotatingButton
- (CGRect) titleRectForContentRect:(CGRect)bounds {
CGRect frame = [super titleRectForContentRect:bounds];
frame.origin.y -= (frame.size.width - frame.size.height) / 2;
frame.size.height = frame.size.width;
return frame;
}
@end
The label of any RotatingButton created in code or on Storyboard can be rotated without being truncated.
[button.titleLabel setTransform:CGAffineTransformMakeRotation(M_PI / 2)];