iOS Simulator Retina 3.5-inch でテストしたところ、うまくいきました。しかし、Retina 4 インチの場合、次の図のように黒い領域が発生します。
この理由が分からない…
アイデアをいただけませんか?
以下はAppDelegate.h&mです
#import <UIKit/UIKit.h>
#import "MenuViewCon.h"
@class TestViewCon;
@interface AppDelegate : UIResponder <UIApplicationDelegate>
@property (strong, nonatomic) UIWindow *window;
@property (strong, nonatomic) TestViewCon *viewController;
@end
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
self.window = [[[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]] autorelease];
// Override point for customization after application launch.
if ([[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPhone) {
self.viewController = [[[TestViewCon alloc] initWithNibName:@"ViewController_iPhone" bundle:nil] autorelease];
} else {
self.viewController = [[[TestViewCon alloc] initWithNibName:@"ViewController_iPad" bundle:nil] autorelease];
}
self.window.rootViewController = self.viewController;
[self.window makeKeyAndVisible];
return YES;
}
次はTestViewCon.h&m
#import <Foundation/Foundation.h>
@interface TestViewCon : UIViewController
@end
#import "TestViewCon.h"
@implementation TestViewCon {
}
- (void)viewDidLoad {
UILabel *label = [[[UILabel alloc] initWithFrame:CGRectMake(100, 100, 100, 100)] autorelease];
label.text = @"Retina 4 inch testing";
[label sizeToFit];
[self.view addSubview:label];
}
@end