このView Controllerを他のいくつかから提示します。に基づいて別の画像を提示するにはどうすればよいですか
- これを提示したView Controller
- 現在のインターフェースの向き
ContextualController
現在、画面サイズの画像で上に開くボタンがあります。ボタンを押した場所に応じて、3 つの異なる画像を呼び出したいと思いますUIViewControllers
。
からと に電話しUIViewController1
たい。からと に電話したい。context_1_landscape
context_1_portrait
UIViewController2
context_2_landscape
context_2_portrait
-(void) viewDidLoad;
{
[super viewDidLoad];
if((self.interfaceOrientation == UIDeviceOrientationLandscapeLeft)|| (self.interfaceOrientation ==UIDeviceOrientationLandscapeRight)){
UIImageView *imageview = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"context_1_landscape.png"]];
[self.view addSubview:imageview];
}
else if ((self.interfaceOrientation ==UIDeviceOrientationPortrait)||(self.interfaceOrientation ==UIDeviceOrientationPortraitUpsideDown)){
UIImageView *imageview = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"context_1_portrait.png"]];
[self.view addSubview:imageview];
}