iphone 5s
のiphone 6s
とiphone 6plus
のサイズに合わせる方法。目的のアプリケーションのレイアウト
は、私はあなたがすべてのボディは、どのように特定のビューコントローラため別々ストーリーボードを作るために私に言うことができれば別のストーリーボードを作成する必要があります。
iphone 5s
のiphone 6s
とiphone 6plus
のサイズに合わせる方法。目的のアプリケーションのレイアウト
は、私はあなたがすべてのボディは、どのように特定のビューコントローラため別々ストーリーボードを作るために私に言うことができれば別のストーリーボードを作成する必要があります。
各画面サイズに別のストーリーボードを使用しないでください。システムには特に機能が含まれているため、その必要はありません。
Appleはオンラインでこのトピックに関する多くの素晴らしいドキュメントを提供しています。私はあなたがこのサイトで始めることをお勧めします:特に
https://developer.apple.com/design/adaptivity/
あなたが自動レイアウトとNSLayoutConstraint
についての情報を検索します。トピックを議論するいくつかのWWDCビデオ(上記のページからリンクされています)があります。
あなたのコメントに感謝します –
AutoLayoutを使用している場合、デバイスごとに別々のストーリーボードは必要ありません。適切な制約とサイズのクラスを指定すると、AutoLayoutはすべてのことを管理しました。
あなたが本当にここでデバイスごとに別々の絵コンテが必要な場合のソリューションです:
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
UIViewController *initialViewController = nil;
UIStoryboard *storyboard;
if ([UIDevice currentDevice].userInterfaceIdiom == UIUserInterfaceIdiomPhone)
{
CGSize iOSDeviceScreenSize = [[UIScreen mainScreen] bounds].size;
if (iOSDeviceScreenSize.height == 667)
{
storyboard = [UIStoryboard storyboardWithName:@"6board" bundle:nil];
initialViewController = [storyboard instantiateInitialViewController];
}else if (iOSDeviceScreenSize.height == 736){
storyboard = [UIStoryboard storyboardWithName:@"6plus" bundle:nil];
initialViewController = [storyboard instantiateInitialViewController];
}else{
storyboard = [UIStoryboard storyboardWithName:@"Main" bundle:nil];
initialViewController = [storyboard instantiateInitialViewController];
}
}else{
storyboard = [UIStoryboard storyboardWithName:@"ipadboard" bundle:nil];
initialViewController = [storyboard instantiateInitialViewController];
}
self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
[self.window makeKeyAndVisible];
self.window.rootViewController = initialViewController;
は、それがあなたを助け願っています...ハッピーCodding
プログラムによる自動レイアウトの追加方法? –
あなたが使用している言語下さいタグ'objective-c'や 'swift' @Manzoorのように –