【发布时间】:2011-10-19 09:02:13
【问题描述】:
我在我的应用程序中使用 AFOpenFlow,但现在的问题是, 我使用的图片大小不一样,因为它们来自网络! 以及如何在 iPhone 视图中自动调整图像大小??? 这是我使用此方法的代码:
- (void)viewDidLoad {
[super viewDidLoad];
// loading images into the queue
loadImagesOperationQueue = [[NSOperationQueue alloc] init];
NSString *imageName;
for (int i=0; i < 10; i++) {
imageName = [[NSString alloc] initWithFormat:@"cover_%d.jpg", i];
[(AFOpenFlowView *)self.view setImage:[UIImage imageNamed:imageName] forIndex:i];
[imageName release];
NSLog(@"%d is the index",i);
}
[(AFOpenFlowView *)self.view setNumberOfImages:10];
}
先谢谢你了 马可
【问题讨论】:
-
为什么不使用 UIImageView 来显示图像?您可以选择图像数据在该视图中的显示方式。然后,如果需要,您可以从该视图中取出数据并将其转换为 jpg。
-
是的,我试过了,但我不知道如何实现,这段代码是 UIImageView
-
问题出在循环的第二行(长行),我怎样才能在那里实现 UIImageView??
标签: iphone uiimage autoresizingmask