Я пытаюсь изменить размер изображения с помощью stretchableImageWithLeftCapWidth: он работает на симуляторе, но на устройстве появляются вертикальные зеленые полосы.Изменение размера изображения с помощью stretchableImageWithLeftCapWidth
Я попытался использовать imageNamed, imageWithContentOfFile и imageWithData загрузить изображение, оно не меняется.
UIImage *bottomImage = [[UIImage imageWithData:
[NSData dataWithContentsOfFile:
[NSString stringWithFormat:@"%@/bottom_part.png",
[[NSBundle mainBundle] resourcePath]]]]
stretchableImageWithLeftCapWidth:27 topCapHeight:9];
UIImageView *bottomView = [[UIImageView alloc] initWithFrame:CGRectMake(10, 200+73, 100, 73)];
[self.view addSubview:bottomView];
UIGraphicsBeginImageContext(CGSizeMake(100, 73));
[bottomImage drawInRect:CGRectMake(0, 0, 100, 73)];
UIImage *bottomResizedImage = UIGraphicsGetImageFromCurrentImageContext();
UIGraphicsEndImageContext();
bottomView.image = bottomResizedImage;
См. Результат: зеленые стержни не должны быть там, они не отображаются на симуляторе.
alt text http://www.quicksnapper.com/files/5161/96232162149F1C14751048_m.png
Ничего себе, спасибо. –