留着吧 以后或许有用:
- (BOOL)shouldAutorotate { NSLog(@"yyyyshouldAutorotate%i",isVideoPlaying);
if (!self.viewStatus) { _viewStatus = [[UIView alloc]initWithFrame:CGRectMake(0, -20, self.view.frame.size.width, 64)]; } if (![self.navigationBar.subviews containsObject:_viewStatus]) {
UIImageView * img = [[UIImageView alloc]initWithFrame:CGRectMake(0, 0, self.view.frame.size.width, 40)];
img.backgroundColor = NAVIGATIONBAR_COLOR; img.alpha = 0.92; [_viewStatus addSubview:img]; [self.navigationBar addSubview:_viewStatus]; [self.navigationBar sendSubviewToBack:_viewStatus]; _viewStatus.backgroundColor = [UIColor whiteColor];
} CGRect frame = self.navigationBar.frame; frame.origin.y = 20; frame.size.height = 44; self.navigationBar.frame = frame; if (isVideoPlaying) { [self.navigationBar setTransform:CGAffineTransformMakeTranslation(0, 0)]; return YES;
}else{
return [[UIDevice currentDevice] orientation] == UIInterfaceOrientationPortrait; } } |