How to get applicationFrame minus height of UINavigationBar?

I put this in a loadView and it works:

CGRect navFrame = [[UIScreen mainScreen] applicationFrame];
navFrame.size.height -= self.navigationController.navigationBar.frame.size.height;
UIImageView *imageView = [[UIImageView alloc] initWithFrame:navFrame];

But is there a variable of type applicationFrame that gives applicationFrame minus the height of the UINavigationBar?

+3
source share
1 answer

It seems that since the three20 does something similar to what I did. In TTGlobalNavigatorMetrics.mthey perform:

CGRect TTNavigationFrame() {
  CGRect frame = [UIScreen mainScreen].applicationFrame;
  return CGRectMake(0, 0, frame.size.width, frame.size.height - TTToolbarHeight());
}

http://github.com/facebook/three20/blob/master/src/Three20UINavigator/Sources/TTGlobalNavigatorMetrics.m#L53

Matt

+2
source

Source: https://habr.com/ru/post/1763274/


All Articles