【问题标题】:Resize images from portrait to landscape mode in iOS在 iOS 中将图像大小从纵向模式调整为横向模式
【发布时间】:2012-05-22 15:38:57
【问题描述】:

将图像从纵向调整为横向的最佳方法是什么?

最好的方法是在转动设备时更改图像?还是使用 IB 中的 autosizing 坐标?

谢谢大家!

最好的问候

【问题讨论】:

    标签: iphone image ipad resize landscape


    【解决方案1】:

    您需要像这样将自动调整大小的蒙版添加到您的图像视图中

    UIImageView *imageView = [[UIImageView alloc]initWithFrame:self.view.frame];
    imageView.contentMode = UIViewContentModeScaleAspectFill;
    imageView.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight;
    [self.view addSubview:imageView];
    [imageView release];
    

    【讨论】:

      【解决方案2】:

      我不知道什么是最好的方法。我喜欢这个

      imageView.autoresizingMask = UIViewAutoresizingFlexibleTopMargin | UIViewAutoresizingFlexibleBottomMargin | UIViewAutoresizingFlexibleLeftMargin | UIViewAutoresizingFlexibleRightMargin;
      

      【讨论】:

        猜你喜欢
        • 2011-09-05
        • 1970-01-01
        • 1970-01-01
        • 2013-06-09
        • 2011-08-07
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        相关资源
        最近更新 更多