質問

I want to make application using theos, but it don't seems to be adjusted 4inch iPhone/iPod. How can I solve this issue?

When I wrote code below and installed, view become like this screenshot.

#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

役に立ちましたか?

解決

There's a very simple solution: just add in your "Resources" folder a black .png image and name it "Default-568h@2x" like this one.

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top