4
votes

I am making a full screen image view that is zoomable and scrollable similar to the one in Twitter for iPhone. I have it almost the same except I cant figure out how to use the real estate under the stats bar.

I start with a UINavigationController and push my image view. My image view is a UIView that contains a UIScrollView with a frame of (0, -44, 320, 480) to put it beneath the navigation bar, and a UIImageView on top of that with a frame of the scroll view's bounds.

I am hiding the navigation bar and status bar using:

[self.navigationController.navigationBar setAlpha:0.0f];
[[UIApplication sharedApplication] setStatusBarHidden:YES];

They hide correctly, but I am left with 20px of black at the top. I tried setting the scroll view's frame y-origin to -66, but that didn't help.

Any ideas?

2
Just a suggestion, but have you tried setting the status bar to black transparent?Tristan
Tried setting it to transparent, but nothing changed.lavoy

2 Answers

0
votes

if u select the view in Interface Builder and go to attribute inspector, make sure those are bars are set to none.

0
votes

Try this method to hide status bar

-(BOOL)prefersStatusBarHidden{
return YES;
}

Also in the viewWillAppear() method, set the navigation bar hidden :

-(void) viewWillAppear:(BOOL)animated{
    [self.navigationController setNavigationBarHidden:YES];
}