I have view which contains a scrollView. When the view shows up the image appears in full screen (320x480) hiding the status and navigation bar. When I tap the screens - status and navigation bar appears on the screen. But this thing shifts the UIScrollView below the the navigation bar. I want the status and nav bar to show over my scroll view.
Like it happens in the photos app. On tapping the image the status and nav bar shows over the scrollView.
Below is how I am positioning the view
//What I have done in viewDidLoad
[[UIApplication sharedApplication] setStatusBarHidden:YES animated:NO];
self.wantsFullScreenLayout = YES;
scrollView = [[UIScrollView alloc] initWithFrame:[[UIScreen mainScreen] applicationFrame]];
self.view = scrollView;
Below is what I am doing on detecting a single tap
- (void)tapDetectingImageView:(TapDetectingImageView *)view gotSingleTapAtPoint:(CGPoint)tapPoint {
// single tap hide/unhide the status and nav bar
NSLog(@"got a single tap");
if (self.navigationController.navigationBarHidden == NO)
{
[self.navigationController setNavigationBarHidden:YES animated:NO];
[[UIApplication sharedApplication] setStatusBarHidden:YES animated:YES];
}
else
{
[[UIApplication sharedApplication] setStatusBarHidden:NO animated:YES];
[self.navigationController setNavigationBarHidden:NO animated:NO];
}
}
Just a pointer for you guys - If I use
[self.view addSubview:scrollView];
I dont see this issue. But this mess up my landscape orientation code.
Anyone who can shed some light what I might be doing wrong - would be great help!