以下是推送代码: +(void)navigateToLocation:(Location *)位置控制器:(UIViewController *)vc withDelegate:(NSObject< LocationEditDelegate> *)delegate {LocationDetailsViewController * detailsController = [[[LocationDetailsViewController alloc] initWithNibName:@"LocationDetailsViewController" bundle:nil];detailsController.title = [位置显示];detailsController.location =位置;detailsController.delegate =委托;//推送细节视图控制器[[vc navigationController] pushViewController:detailsController动画:是];[detailsController发布];} 有人可以帮助我了解发生了什么以及如何进入其中吗?我已经安装了2.2.1,并使用2.2进行了构建/部署.由于似乎未显示评论,因此我在底部进行注释.如果我做错了事,请编辑此内容:我添加了模拟指标,但行为没有变化.解决方案我前一段时间遇到了这个问题.如果我没记错的话,在IB上方选中了一个自动调整大小视图以填充屏幕"框.我认为它在标签栏上的某处.取消选择它解决了我的问题I have a tabbed application with each tab having a navigation controller. I use helper code to push a view/controller pair onto the navigation stack yet when I call this same code from two different places I get (suprizingly) different results. In one case the view renders lower than in the other case, seemingly lower by a navigation bar height.Pushed from one tab (in good position) :Pushed from another tab (too low):The XIB:Here is the push code:+ (void)navigateToLocation:(Location*)location controller:(UIViewController*)vc withDelegate:(NSObject <LocationEditDelegate> *)delegate { LocationDetailsViewController *detailsController = [[LocationDetailsViewController alloc] initWithNibName:@"LocationDetailsViewController" bundle:nil]; detailsController.title = [location display]; detailsController.location = location; detailsController.delegate = delegate; // Push the detail view controller [[vc navigationController] pushViewController:detailsController animated:YES]; [detailsController release];}Can anybody help me understand what might be going on, and how I get inside this?I have 2.2.1 installed and build/deploy using 2.2.Since comments do not appear to show, I am annotating at the bottom. Edit this if I am doing things incorrectly:I have added simulated metrics with no change in behavior. 解决方案 I've had this problem a while ago. If I remember correctly, off the top of my head, there was an "Autoresize view to fill screen" box that was checked in IB. I think it was somewhere on the tabbar. Deselecting it solved my problem 这篇关于iPhone NavigationController-推送了相同的视图,收到了不同的布局的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持! 09-12 15:47