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 BTW..) ,than call above function to rotate the fullScreenView.In iOS7 ,subViews in fullScreenView is working well ,in iOS 8,the fullScreenView has rotate,and content in it has rotated too,but the frame can not change...
Aucun commentaire:
Enregistrer un commentaire