如何更改 UIImageview 上图像显示的大小,我正在使用 AFNETWORKING 下载图像,它适合 UIImageView 的大小。
但是我想只显示一半的图像,就像 Facebook 应用程序你只看到图像的一部分点击图像查看完整图像一样。谢谢
UIImageView *posterImage = [[UIImageView alloc]init];
posterImage.frame = CGRectMake(index * showsScrollView.bounds.size.width + 50, 40, 225, 337);
[showsScrollView addSubview:posterImage];
// 6.5 - Asynchronously load the image
NSURLRequest *request = [NSURLRequest requestWithURL:[NSURL URLWithString:posterUrl]];
[posterImage setImageWithURLRequest:request placeholderImage:[UIImage imageNamed:@"page.png"]
success:^(NSURLRequest *request, NSHTTPURLResponse *response, UIImage *image) {
[[AFNetworkActivityIndicatorManager sharedManager] decrementActivityCount];
} failure:^(NSURLRequest *request, NSHTTPURLResponse *response, NSError *error) {
[[AFNetworkActivityIndicatorManager sharedManager] decrementActivityCount];
}];
[[AFNetworkActivityIndicatorManager sharedManager] incrementActivityCount];
谢谢。