我有一些奇怪的事情 - 在AVPlayer
旋转之后,我通过计时器更新textField和进度滑块,但是使用控制器查看在AVPlayer
之后更改坐标
mPlayer = [[AVPlayer alloc] init];
mPlayer = [mPlayer initWithURL:streamURL];
playerLayer = [AVPlayerLayer playerLayerWithPlayer:mPlayer];
[[[self view] layer] insertSublayer:playerLayer atIndex:0];
[playerLayer setFrame:self.view.bounds];
旋转
-(void) didRotateFromInterfaceOrientation:(UIInterfaceOrientation)fromInterfaceOrientation
{
playerLayer.frame = CGRectMake(0, 0, self.view.frame.size.width, self.view.frame.size.height - self.ButtonsView.frame.size.height);
if([[UIDevice currentDevice]orientation]==UIDeviceOrientationLandscapeLeft||[[UIDevice currentDevice]orientation]==UIDeviceOrientationLandscapeRight)
{
self.ButtonsView.frame = CGRectMake((self.view.frame.size.width - self.ButtonsView.frame.size.width) /2, playerLayer.frame.size.height, self.view.frame.size.width, self.ButtonsView.frame.size.height);
}
}
并且在更改计时器后,ButtonView的坐标变错了
- (void)updateTime:(NSTimer *)timer {
self.tfCurrent.text = [self textFormatting : self.videoCurrentTime];
}
第一个第二个coords是好的。为什么我的视图会重绘?谢谢!