我想用theos制作应用程序,但它似乎不适合4inch iPhone/iPod。 我该如何解决这个问题?
当我在下面编写代码并安装时, View 变成了这个截图。
#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
最佳答案
有一个非常简单的解决方案:只需在“资源”文件夹中添加一个黑色的 .png 图像并将其命名为“Default-568h@2x”,如 this one .
关于ios - 如何调整 4inch theos-application,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23337197/