このView Controllerを他のいくつかから提示します。に基づいて別の画像を提示するにはどうすればよいですか
- これを提示したView Controller
- 現在のインターフェースの向き
ContextualController現在、画面サイズの画像で上に開くボタンがあります。ボタンを押した場所に応じて、3 つの異なる画像を呼び出したいと思いますUIViewControllers。
からと に電話しUIViewController1たい。からと に電話したい。context_1_landscapecontext_1_portraitUIViewController2context_2_landscapecontext_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];
}