2013-02-12 306 views
1

我已經通過複製目標將iPhone xib複製到iPad xib中,現在我的大多數xib都已正確轉換爲iPad大小,但是某些xib仍然只顯示爲iphone大小。除了大多數GUI功能,如警報視圖顯示,操作表都不是iPad的。我需要做出什麼樣的改變才能在iPad上完美工作。圖形用戶界面重複xib後GUI不正確?

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions 
{ 
    self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]]; 
    // Override point for customization after application launch. 
    self.viewController = [[ViewController alloc] initWithNibName:@"ViewController" bundle:nil]; 
    self.window.rootViewController = self.viewController; 
    [self.window makeKeyAndVisible]; 
    return YES; 
} 

編輯:GUI問題我已經給在動作片兩個可選的YES和NO,YES僅顯示沒有被藏匿的地方..

enter image description here

感謝

+0

你實際使用時,應用程序加載的筆尖的iPad版解決問題了嗎?如果是這樣,請給我們看看它的代碼。 – trojanfoe 2013-02-12 11:15:51

+0

你想知道我是如何加載的? – Newbee 2013-02-12 11:21:40

+0

是的。向我們展示檢測設備並加載正確的筆尖文件的代碼。 – trojanfoe 2013-02-12 11:22:33

回答

1

你AREN」 t在應用程序啓動時加載正確的NIB。這是由Xcode的「單一視圖」應用程序模板,其檢測所述裝置和加載適當的NIB文件中提供的代碼:

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions 
{ 
    self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]]; 
    // Override point for customization after application launch. 
    if ([[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPhone) { 
     self.viewController = [[MainViewController alloc] initWithNibName:@"MainViewController_iPhone" bundle:nil]; 
    } else { 
     self.viewController = [[MainViewController alloc] initWithNibName:@"MainViewController_iPad" bundle:nil]; 
    } 
    self.window.rootViewController = self.viewController; 
    [self.window makeKeyAndVisible]; 
    return YES; 
} 
+0

請檢查圖形用戶界面問題的編輯,我已經給出了兩個選項,在該工作表YES和NO,只有YES顯示NO隱藏在某處.. – Newbee 2013-02-12 11:31:08