【问题标题】:How can I adjust 4inch theos-application如何调整 4inch theos-application
【发布时间】:2014-04-28 09:20:58
【问题描述】:

我想用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

【问题讨论】:

    标签: ios screen device theos


    【解决方案1】:

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

    【讨论】:

      猜你喜欢
      • 2013-08-12
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2014-02-09
      • 1970-01-01
      相关资源
      最近更新 更多