整个设备横屏

- (void)transformView

{

if([[UIDevicecurrentDevice]respondsToSelector:@selector(setOrientation:)]) {

SELselector =NSSelectorFromString(@"setOrientation:");

NSInvocation*invocation = [NSInvocationinvocationWithMethodSignature:[UIDeviceinstanceMethodSignatureForSelector:selector]];

[invocationsetSelector:selector];

[invocationsetTarget:[UIDevicecurrentDevice]];

intval =UIInterfaceOrientationLandscapeRight;

[invocationsetArgument:&val atIndex:2];

[invocationinvoke];

}

//self.view.layer.anchorPoint = CGPointMake(0.5, 0.5);

//self.view.frame = (CGRect){0,0,self.view.bounds.size.height,self.view.bounds.size.width};

self.view.transform=CGAffineTransformMakeRotation(M_PI_2);

你可能感兴趣的:(整个设备横屏)