| Issue 4: | screen rotation | |
| 1 person starred this issue and may be notified of changes. | Back to list |
Awesome piece of code. I was surprised to drop this into my project and have it work the 1st time wo any alterations. I have found 1 issue, unfortunately i can't tinker with it because I don't have a vga capable device. What I see is that in landscape mode a screen that is underneath the currently visible screen is rotating around so that you can see the corners of the screen as they rotate underneath the current form. I was wondering if there was a fix for this, thanks?
Jan 18, 2011
In file UIApplication+ScreenMirroring.m at line 168 add this: [mirrorLayer removeAllAnimations];
the method should look like this:
- (void)updateMirroredWindowTransformForInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
// Grab the secondary window layer
CALayer *mirrorLayer = g_mirroredScreenWindow.layer;
// Rotate the screenshot to match interface orientation
switch (interfaceOrientation) {
case UIInterfaceOrientationPortrait:
mirrorLayer.transform = CATransform3DIdentity;
break;
case UIInterfaceOrientationLandscapeLeft:
mirrorLayer.transform = CATransform3DMakeRotation(M_PI / 2, 0.0f, 0.0f, 1.0f);
break;
case UIInterfaceOrientationLandscapeRight:
mirrorLayer.transform = CATransform3DMakeRotation(-(M_PI / 2), 0.0f, 0.0f, 1.0f);
break;
case UIInterfaceOrientationPortraitUpsideDown:
mirrorLayer.transform = CATransform3DMakeRotation(M_PI, 0.0f, 0.0f, 1.0f);
break;
default:
break;
}
[mirrorLayer removeAllAnimations];
}
|
6.9 MB Download