カスタム UIAlertView のような UITabBarController の上に表示したい UIViewController があります。問題は、UIViewController を表示するときに、現在使用されている画面に合わせてビューのサイズを変更できないことです。UIViewController (ShareViewController はその名前です) は .xib ファイルを使用して設計されており、現在は iPhone 5 の画面の高さを使用しています。アプリが任意のデバイスで実行されている場合、基本的には UIView (ビュー) のサイズを変更したいだけですが、setFrame を呼び出すと機能しません。
ここにいくつかのコードがあります:
ShareViewController * svc = [[ShareViewController alloc] initWithNibName:@"ShareViewController" bundle:nil];
self.tabBarController.modalPresentationStyle = UIModalPresentationCurrentContext;
[self.tabBarController presentViewController:svc animated:NO completion:nil];
[svc.view setFrame:[[UIScreen mainScreen] applicationFrame]];
「UIModalPresentationCurrentContext」設定を使用して、ShareViewController を透明な背景で表示できるようにします。したがって、このコードを実行すると、ShareViewController が追加されますが、iPhone 5 のディスプレイの高さにまだあるため、画面から消えます。
ShareViewController のメイン ビューのサイズを変更するにはどうすればよいですか?