UIView * fullScreenView = [self.view viewWithTag:999];
CGFloat degrees = [self degreesForOrientation:orientation];
[UIView animateWithDuration:0.3 animations:^{
fullScreenView.transform = CGAffineTransformMakeRotation(degreesToRadians(degrees));
CGRect frame = self.view.frame;
if (degrees!=0) {
frame.size.height = self.view.frame.size.width;
frame.size.width = self.view.frame.size.height;
}
fullScreenView.bounds = frame;
[videoPlayer.view setNeedsDisplay];
[fullScreenView setNeedsDisplay];
}];
there is some subViews in fullScreenView ,like button ,and AVPlayerPreviewView. when I rotate the device (I used autoLayout BDY..) ,than call above function to rotate the fullScreenView.In iOS7 ,subViews in fullScreenView is working nomaly ,in iOS 8,the fullScreenView has rotate,but the content in it has rotated,but the frame not change...
Aucun commentaire:
Enregistrer un commentaire