如以下代码所示,设置 UINavigationController 对象的 contentSizeForViewInPopover 属性似乎失败。这种行为是否符合预期?我犯了一些错误吗?谢谢。
(使用 XCode 4.6,Mac OS X v 10.7.5)
// Make a plain view controller.
UIViewController * root = [[UIViewController alloc] init];
// Make a navigation controller whose root view is the plain
// view controller from above.
UINavigationController * nav =
[[UINavigationController alloc] initWithRootViewController: root];
// Set the content size for popover to 100 x 100.
nav.contentSizeForViewInPopover = CGSizeMake(100, 100);
// Print out the property that we just set.
NSLog (@"size = (%f, %f)",
nav.contentSizeForViewInPopover.width,
nav.contentSizeForViewInPopover.height);
// It prints: size = (320.000000, 1144.000000)