Search code examples
iosobjective-cuinavigationcontrolleravplayerviewcontroller

UINavigationController hides AVPlayerViewController progress slider


I'm using AVPlayerViewController with the UINavigationController like following code.

AVPlayerViewController* audioPlayer = [[AVPlayerViewController alloc] init];
audioPlayer.audioFilePath = recordFilePath;
[self.navigationController pushViewController:audioPlayer animated:YES];

When the AVPlayerViewController appeared, the progress slider had been hidden by the UINavigationBar control.

How can I show the progress slider along with the UINavigationBar?


Solution

  • Try to set the navigation bar's translucent property to "NO" in your viewDidLoad

    self.navigationController.navigationBar.translucent = NO;

    It will start the view from being framed underneath the navigation bar and status bar. Hence you can see AVPlayerViewController progress slider.