如何调整4英寸theos-application

时间:2014-04-28 09:20:58

标签: ios screen device theos

我想使用theos进行应用程序,但它似乎没有调整到4英寸的iPhone / iPod。 我该如何解决这个问题?

当我在下面编写代码并安装时,视图就像这个截图一样。

#import "RootViewController.h"

@implementation RootViewController
- (void)loadView {
self.view = [[[UIView alloc] initWithFrame:[[UIScreen mainScreen] applicationFrame]] autorelease];
self.view.backgroundColor = [UIColor whiteColor];
}

- (void)viewWillAppear:(BOOL)animated {
[super viewWillAppear:animated];
UIButton *btn = [UIButton buttonWithType:UIButtonTypeRoundedRect];
[btn setTitle:@"Button" forState:UIControlStateNormal];
btn.frame = CGRectMake(0,0,100,100);
[self.view addSubview:btn];
[btn release];

CGRect jbrect = [UIScreen mainScreen].bounds;
NSString *jbstr = [[NSString alloc] initWithFormat:@"%f,%f,%f,%f",jbrect.origin.x, jbrect.origin.y, jbrect.size.width, jbrect.size.height];

UIAlertView *jbalert = [[UIAlertView alloc] initWithTitle:@"Called!" message:jbstr delegate:nil cancelButtonTitle:@"cancel" otherButtonTitles:nil];
[jbalert show];
[jbalert release];

}
@end

enter image description here

1 个答案:

答案 0 :(得分:2)

有一个非常简单的解决方案:只需在“资源”文件夹中添加一个黑色.png图像,并将其命名为“Default-568h @ 2x”,如this one