0

I have an application with a tab bar controller and a navigation controller. In one of the child content views of the navigation controller, I have a image view at the top and some buttons at the bottom. The problem is that the navigation bar obscures the top portion of the image view. My content view is loaded from a NIB file and the image is set at run time. The strange thing is, in another child view I have a table view and that appears correctly.

4

2 回答 2

1

首先,确保您的 autoresizingMask 在您的视图中正确设置(请参阅尺寸检查器中的自动调整大小设置,CMD+3)。 iPhone 开发中心的 UINavigationController 概述说:

注意:由于自定义视图的可用空间量可能会有所不同(取决于其他导航视图的大小),因此您的自定义视图的 autoresizingMask 属性应设置为具有灵活的宽度和高度。在显示视图之前,导航控制器会自动对其进行定位和调整大小以适应可用空间。

然后,确保您的 imageview 上的自动调整大小设置未设置为灵活高度。

可能发生的是:

  1. UINavigationController 从 nib 文件调整视图的大小(缩小高度)。
  2. 您视图中的 UIImageView 已按比例缩小,因为父视图已调整大小,这使其看起来像是被剪裁了。
于 2009-11-25T19:57:42.377 回答
0

可能是您将内容视图设置得太大了吗?在 InterfaceBuilder 中,您可以在视图的 cmd+1 中启用占位符标签栏 + 导航栏。这样,您就可以将其设计为完全适合。或者,您可以在 IB 中修复 cmd+3 下的内容框架的大小。

于 2009-09-16T11:22:59.863 回答