I have a view that contains scrollView. When the view appears, the image is displayed in full screen (320x480), hiding the status and navigation bar. When I click on the screens, the status and navigation bar appear on the screen. But this thing shifts the UIScrollView under the navigation bar. I want the status and navigation bar to appear on top of my scroll view.
How this happens in the photo app. When you click on the status icon and the navigation bar is displayed above the scrollView.
Below is how I position the view.
[[UIApplication sharedApplication] setStatusBarHidden:YES animated:NO];
self.wantsFullScreenLayout = YES;
scrollView = [[UIScrollView alloc] initWithFrame:[[UIScreen mainScreen] applicationFrame]];
self.view = scrollView;
The following is what I do when a single click is detected
- (void)tapDetectingImageView:(TapDetectingImageView *)view gotSingleTapAtPoint:(CGPoint)tapPoint {
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 do not see this problem. But that will ruin my terrain orientation code.Anyone who can shed light on what I might have done wrong will be a great help!
source
share