2009-07-07 82 views

回答

1

的〔navigationController視圖]自動調整「欠重疊」半透明導航欄作爲OS 3.0

的可以簡單地添加44個像素到原點屬性的y值克服這一點。

0

您可以使用44如果你知道你的肖像是(不景觀,其中導航欄的高度小於44)

你也可以這樣做:

// applicationFrame subtracts the height of the statusBar if it's visible. 
// bounds doesn't take into account the statusBar. 
CGRect navFrame = [[UIScreen mainScreen] applicationFrame]; 
NSLog(@"navFrame: %f x %f", navFrame.size.width, navFrame.size.height); 
navFrame.size.height -= self.navigationController.navigationBar.frame.size.height; 
NSLog(@"navFrame: %f x %f", navFrame.size.width, navFrame.size.height); 
UIImageView *imageView = [[UIImageView alloc] initWithFrame:navFrame]; 
NSLog(@"imageView: %@", imageView); 

我學會了這從閱讀three20的源代碼。你可以在github.com找到它

Matt