how to rotate UI segmented control
hey all i want to know rotate the UI Segmented control to be开发者_StackOverflow in a vertical look
cheer
BOB
You can do in this way.
#define degreesToRadians(x) (M_PI * x / 180.0)
[...]
segControl.transform =
CGAffineTransformRotate(segControl.transform, degreesToRadians(90));
if you want set correct position, remember that it consider the center of segControl!
ex:
segControl.frame = CGRectMake(-125, 220, 320, 30);
hope this helps.
I haven't done something like that before but I think one approach could be to subclass UISegmented control and use Affine Transforms related functions inside the Core Graphics framework, there you use for example CGContextRotateCTM() to give a 90 degrees rotation. Hope this helps.
精彩评论