モードのみで作るアプリを作っていますiPhone
。アプリには、ユーザーが写真に触れると、それ自体が になるポイントがあります。私がそれを行う方法は、別のView Controllerへのセグエを介して、aがスペース全体を占めることです。で画像を表示するためにデバイスを回転させたいと思います。iPod
portrait
fullscreen
UIImageView
landscape
landscape
それはどのように可能ですか?
第 2 段階: ビューを作成する方法を知りたいfullscreen
ので、画像が画面全体に表示されるようにします。
基本的に:写真をtwitterアプリと同じように動作させたい。:)
ありがとう
編集:これは、画像を表示するための私のクラスのコードです
#import "ImageViewer.h"
@interface ImageViewer ()
@end
@implementation ImageViewer
@synthesize scrollView;
@synthesize imageView;
@synthesize image;
- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
{
self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
if (self) {
// Custom initialization
}
return self;
}
- (void)viewDidLoad
{
[super viewDidLoad];
// Do any additional setup after loading the view.
CGRect imageFrame = CGRectMake(0, 0, self.imageView.image.size.width, self.imageView.image.size.height);
self.imageView.frame = imageFrame;
self.scrollView.contentSize = imageFrame.size;
}
- (UIView *) viewForZoomingInScrollView:(UIScrollView *)sender
{
return self.imageView;
}
- (void)didReceiveMemoryWarning
{
[super didReceiveMemoryWarning];
// Dispose of any resources that can be recreated.
}
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
{
NSLog(@"rotate.");
return YES;
}
- (void)viewDidUnload {
[self setImageView:nil];
[self setScrollView:nil];
[super viewDidUnload];
}
@end