Sam Jarman
Sam Jarman

Reputation: 7377

make a vertical UIButton

is there anyway to have a UIButton display vertical, with the text reading down, instead of across? can you do it with IB or programatically? or will you have to photoshop to make a custom button?

cheers, Sam

Upvotes: 2

Views: 939

Answers (1)

Henrik P. Hessel
Henrik P. Hessel

Reputation: 36627

// Define the transform
CGAffineTransform transform = CGAffineTransformMakeRotation(90 * (M_PI / 180));

// Initialize the UIView
UIView *myView    = [[UIView alloc] initWithFrame:CGRectMake(0, 0, 320, 320)];

// Do the transformation
// in this case, rotate the UIView 90 degrees
myView.transform = transform;

Source

Upvotes: 2

Related Questions