Ios UIImageView仅显示低质量的全屏图像

Ios UIImageView仅显示低质量的全屏图像,ios,objective-c,uiimageview,Ios,Objective C,Uiimageview,我正在UIImageView中显示一个图像作为应用程序的背景图像。这是一张由盖蒂或shutterstock或其他人拍摄的专业照片。起初我放了3个照片尺寸。详情如下: 320 x 536 640 x 1136 960 x 1704 这会产生起伏的图像。因此,我没有将640 x 1136缩小到320 x 568,而是实际购买了尺寸,以保持分辨率并降低噪音。不管我做什么,它们总是以波涛汹涌和质量低劣而告终。关于为什么会发生这种情况,有什么建议吗?他们应该是高质量的 雅虎天气应用程序完美地做到了这一点

我正在UIImageView中显示一个图像作为应用程序的背景图像。这是一张由盖蒂或shutterstock或其他人拍摄的专业照片。起初我放了3个照片尺寸。详情如下:

320 x 536
640 x 1136
960 x 1704
这会产生起伏的图像。因此,我没有将640 x 1136缩小到320 x 568,而是实际购买了尺寸,以保持分辨率并降低噪音。不管我做什么,它们总是以波涛汹涌和质量低劣而告终。关于为什么会发生这种情况,有什么建议吗?他们应该是高质量的

雅虎天气应用程序完美地做到了这一点。高质量的图片。为什么我的应用程序会出现这样的问题

下面是我用来设置背景图像的代码

PARootViewController-这是初始化。此类将启动所有其他屏幕和身份验证

[[NSUserDefaults standardUserDefaults] removeObjectForKey:kPAPreviousBackgroundImageIndex];

NSInteger randomNumber;
NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
NSInteger previousBackgroundIndex = [defaults integerForKey:kPAPreviousBackgroundImageIndex];

do {
    randomNumber = [PAProfileObject getRandomNumberBetween:0 to:[self.backgrounds count]];
} while (randomNumber == previousBackgroundIndex);

NSLog(@"Background image at index: %ld\nNumber of backgrounds: %ld",randomNumber,[self.backgrounds count]-1);

[defaults setInteger:randomNumber forKey:kPAPreviousBackgroundImageIndex];
[defaults synchronize];
PABaseViewController-其他每个视图控制器都继承自此,因此它为使用的每个视图控制器设置背景

self.backgrounds = @[[UIImage imageNamed:@"background-02-i5"],
                     [UIImage imageNamed:@"racing-the-sun"],
                     [UIImage imageNamed:@"background-03-i5"],
                     [UIImage imageNamed:@"background-04-i5"],
                     [UIImage imageNamed:@"background-05-i5"],
                     [UIImage imageNamed:@"background-06-i5"],
                     [UIImage imageNamed:@"background-07-i5"],
                     [UIImage imageNamed:@"background-08-i5"],
                     [UIImage imageNamed:@"background-09-i5"],
                     [UIImage imageNamed:@"background-10-i5"],
                     [UIImage imageNamed:@"background-11-i5"]];

NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
NSInteger backgroundIndex = [defaults integerForKey:kPAPreviousBackgroundImageIndex];

if (backgroundIndex >= [self.backgrounds count])
    backgroundIndex = [self.backgrounds count]-1;

self.backgroundImage = [self.backgrounds objectAtIndex:backgroundIndex];

CGRect screen = [[UIScreen mainScreen] bounds];
self.backgroundImageView = [[UIImageView alloc] initWithFrame:screen];
self.backgroundImageView.image = self.backgroundImage;
[self.view insertSubview:self.backgroundImageView belowSubview:self.blurView];
PADashboardViewController-主屏幕。它的顶部有一个按钮,用户可以在背景中切换以进行测试。现在,我将它设置为我专门处理的背景

- (IBAction)nextBackgroundPressed:(id)sender {
    NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
    NSInteger currentBackground = [defaults integerForKey:kPAPreviousBackgroundImageIndex];

    if (currentBackground < [self.backgrounds count]-1)
        currentBackground++;
    else
        currentBackground = 0;

 // self.backgroundImageView.image = [self.backgrounds objectAtIndex:currentBackground];
    self.backgroundImageView.image = [UIImage imageNamed:@"background-01-i5"];

    [defaults setInteger:currentBackground forKey:kPAPreviousBackgroundImageIndex];
    [defaults synchronize];
}
他们是好形象。高质量,直接从shutterstock获得。问题不在于形象。只有当我把它放到应用程序中时,它才看起来像这样。完全相同图像的并排屏幕截图。一个在应用程序中,一个在OSX图像查看器中。为什么这个应用程序如此粗糙


这些文件叫什么?您正在使用资产目录吗?使用资产目录!!您可以在图像视图中显示用于设置图像的代码吗?是的,我使用的是资产目录。我将编辑我的帖子以显示代码所有的图像都在一个图像集中吗?i、 e.它们应该是一套设备的1x、2x和3x部分。是的,它们是。我在每个图像中有1个、2个和3个。320 x 568、640 x 1136和960 x 1704您是否设置图像视图的内容模式?很难说为什么没有看到更多的项目。