简体   繁体   English

为弹出视图控制器创建NIB文件

[英]Create a NIB file for a popover view controller

I am certain that I am missing something very obvious, but... 我可以肯定我遗漏了一些非常明显的东西,但是...

I want to create a XIB file that contains a view controller (with its embedded view) for display in a popup. 我想创建一个包含视图控制器(及其嵌入式视图)的XIB文件,以便在弹出窗口中显示。 Create the XIB itself is not a problem, but sizing it is: Since it assumes it is a top-level view, it insists that it be full screen size, rather than the reduced size of a popover. 创建XIB本身不是问题,但调整大小是:由于它假定它是顶级视图,因此它坚持认为它是全屏尺寸,而不是缩小的弹出窗口尺寸。

Is there a way of doing this, or am I stuck with creating the controller and view programmatically? 有没有办法做到这一点,还是我坚持创建控制器并以编程方式查看?

在界面构建器中禁用该视图的所有模拟用户界面元素-状态栏,导航栏等。“界面构建器”不允许您使用存在的元素调整视图的大小。

使用setPopoverContentSize设置popOver视图的大小。例如,这将更改弹出窗口的内容视图的大小。

[aPopover setPopoverContentSize:CGSizeMake(200, 300) animated:YES];

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM