Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/image/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Image 允许在仅纵向应用程序中以横向方式查看图像_Image_Ios5_Uiimageview_Orientation_Segue - Fatal编程技术网

Image 允许在仅纵向应用程序中以横向方式查看图像

Image 允许在仅纵向应用程序中以横向方式查看图像,image,ios5,uiimageview,orientation,segue,Image,Ios5,Uiimageview,Orientation,Segue,我正在制作一个iPhone和iPod应用程序,我将只在纵向模式下制作。应用程序中有一个点,如果用户触摸一张图片,它会使自己全屏显示。我这样做的方式是通过一个序列到另一个视图控制器,其中UIImageView占据了整个空间。我希望能够在横向中旋转设备,以便在横向中查看图片 怎么可能呢 在第二个阶段:我想知道如何使视图全屏,这样图片就可以填满整个屏幕 基本上:我希望图片的行为与twitter应用程序一样: 谢谢 编辑:这是我的类中查看图像的代码 #import "ImageViewer.h" @i

我正在制作一个
iPhone
iPod
应用程序,我将只在
纵向
模式下制作。应用程序中有一个点,如果用户触摸一张图片,它会使自己全屏显示。我这样做的方式是通过一个序列到另一个视图控制器,其中
UIImageView
占据了整个空间。我希望能够在
横向
中旋转设备,以便在
横向
中查看图片

怎么可能呢

在第二个阶段:我想知道如何使视图
全屏
,这样图片就可以填满整个屏幕

基本上:我希望图片的行为与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

您可以调整图幅的大小。。。就像iphone中的view.frame=CGRectMake(0,0320480)一样,除了iphone5…这怎么会只允许图像的横向,这就是我想要的?请帮助?我已经调整了图像视图的框架大小,但是图像没有旋转,或者没有完全显示。嗨,你能发布一些代码吗?请更好地理解我编辑了我的文章。我希望能够旋转设备,以横向方式查看图像,并全屏查看。