3

これをloadViewに入れて動作します:

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

しかし、applicationFrame から UINavigationBar の高さを引いた値を与える applicationFrame のような変数はありますか?

4

1 に答える 1

2

three20が私がしたことと似たようなことをしているので、ないようです。ではTTGlobalNavigatorMetrics.m、次のことを行います。

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

マット

于 2010-09-04T23:24:47.613 に答える