ios - 如何调整 4inch theos-application

标签 ios screen device theos

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

enter image description here

最佳答案

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

关于ios - 如何调整 4inch theos-application,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23337197/

相关文章:

ios 11 imessage 扩展 message.url 无法打开 safari

ios - 键盘扩展 : Is it possible to inherit features and UI from the stock iOS keyboard?

ios - 如何编写 SQlite 查询进行多行更新

ios - 字符串数组swift 3中不区分大小写的匹配搜索

android - Android中屏幕闪烁的最快方法

linux -/proc/devices 仍然显示未注册的设备

ios - 边界检查错误

android - 为多种屏幕尺寸设计Android应用程序

android - 当屏幕在 Android 中被阻止时?

gps - 廉价的可编程GPS设备