iPhone Status bar disappearing in app using KTPhotoBrowser gallery when moving between KTPhotoScrollViewController and KTThumbsViewController

StackOverflow https://stackoverflow.com/questions/10217525

Pregunta

I'm using the KTPhotoBrowser library to create a photo gallery in my iPhone app. The gallery consists of a thumbnail view (KTThumbsViewController) and a scroll view (KTPhotoScrollViewController) which displays the full size photos like in the official iPhone photo app.

I've managed to get everything working fine but sometimes when navigating back to the thumbnail view from the photo scroll view the status bar disappears leaving a 20px black gap at the top of the screen where the status bar once was.

This has a serious knock on effect for the whole navigation stack as the views dimensions alter from being (320,416) to (320,436) resulting in everything shifting up 20px.

Has anyone else encountered this issue and if so have you been able to resolve it?

¿Fue útil?

Solución

I have managed to come up with an interim solution which prevents the app from breaking.

In KTPhotoScrollViewController.m I have commented out the following code in the toggleChrome method:

 /*  if ([[UIApplication sharedApplication]  respondsToSelector:@selector(setStatusBarHidden:withAnimation:)]) {

    [[UIApplication sharedApplication] setStatusBarHidden:hide withAnimation:NO];

 } else {  // Deprecated in iOS 3.2+.

  id sharedApp = [UIApplication sharedApplication];  // Get around deprecation warnings.
 [sharedApp setStatusBarHidden:hide animated:NO];

 } */

This means that the status bar never hides and as a result the issue of it disappearing when transitioning between views never occurs.

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top