¿Cómo obtener el applicationFrame menos la altura de la UINavigationBar?
-
01-10-2019 - |
Pregunta
Pongo esto en loadView y funciona:
CGRect navFrame = [[UIScreen mainScreen] applicationFrame];
navFrame.size.height -= self.navigationController.navigationBar.frame.size.height;
UIImageView *imageView = [[UIImageView alloc] initWithFrame:navFrame];
Pero, ¿existe una variable como applicationFrame que da la applicationFrame menos la altura UINavigationBar?
Solución
Parece que hay no es ya Three20 hace algo similar a lo que hice. En TTGlobalNavigatorMetrics.m
, que hacen:
CGRect TTNavigationFrame() {
CGRect frame = [UIScreen mainScreen].applicationFrame;
return CGRectMake(0, 0, frame.size.width, frame.size.height - TTToolbarHeight());
}
Matt
Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow