iPhone NavigationController-推送了相同的视图,收到了不同的布局 [英] iPhone NavigationController - same view pushed, different layouts received

查看:46
本文介绍了iPhone NavigationController-推送了相同的视图,收到了不同的布局的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个选项卡式应用程序,每个选项卡都有一个导航控制器.我使用帮助程序代码将视图/控制器对推入导航堆栈,但是当我从两个不同的地方调用相同的代码时,我得到(令人惊讶的)不同的结果.在一种情况下,视图的渲染效果比另一种情况要低,似乎比导航栏的高度要低.

从一个标签页(处于适当位置)推送:

从另一个标签中推送(太低):

XIB:

以下是推送代码:

  +(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-推送了相同的视图,收到了不同的布局的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆