【发布时间】:2012-10-14 04:04:11
【问题描述】:
为什么 XCode 4.5.1 中的 Ipad 模拟器在以编程方式签出时显示错误的大小?
MainViewController.m
- (void)viewDidLoad{
[super viewDidLoad];
[self.view setBackgroundColor:[UIColor redColor]];
NSLog(@"self.view width : %f",self.view.frame.size.width);
NSLog(@"self.view height : %f", self.view.frame.size.height);
mTextView = [[UITextView alloc] initWithFrame:CGRectMake(10.0, 10.0, self.view.frame.size.width - 20, self.view.frame.size.height/2)];
[self.view addSubview:mTextView];
}
我得到的输出是
self.view width : 320.000000
self.view height : 548.000000
我的项目规范
- 通用项目
- 以 iOS 6.0 为目标
- 我绝对确定我选中了“targeted for ipad” 创建 MainViewController 时的复选框
- 不知道是否重要,但“使用 xib 为用户界面” 未选中。
这是一个添加了文本视图的屏幕截图
【问题讨论】:
标签: ios xcode ipad ios6 simulator