I have a subclass of a UIButton.
Here’s the code I have to attempt to rotate it.
-(void)drawRect:(CGRect)rect {
CGContextRef context = UIGraphicsGetCurrentContext();
CGFloat angle = (-126.0 * M_PI) / 180.0;
CGContextRotateCTM(context, angle);
}
But, nothing’s happening. The view draws to the screen in its default orientation. Any idea what I’m missing? Thanks!
Normally when you want to rotate a button, you don’t do it by subclassing and modifying drawRect.
All you have to do is: