看了 iKevin 的 《AFNetworking 初探》这篇笔记(以上内容)之后,我在目前做的项目中,也用到了。我附上我部分的相关内容的代码,供大家参考下。iKevin的博客:
http://ikevin.tw/308
if
(view
==
nil){
//create a view
view
=
[[UIImageView
alloc]
initWithFrame:CGRectMake(
0,
0,
180.0f,
200.0f)];
//activityView.refActivityImage 为倒影图片
[activityView.refActivityImage setImage:[[UIImage imageNamed:
@"bg_photo.png"
] reflectionWithAlpha:
0.3
]];
//activityView.activityImage 为正常图片
[activityView.activityImage setImageWithURLRequest:request
placeholderImage:[UIImage imageNamed:
@"bg_photo.png"
]
success:^(NSURLRequest *request, NSHTTPURLResponse *response, UIImage *image) {
[activityView.refActivityImage setImage:[[activityView.activityImage image] reflectionWithAlpha:
0.3
]];
}
failure:^(NSURLRequest *request, NSHTTPURLResponse *response, NSError *error) {
[activityView.refActivityImage setImage:[[UIImage imageNamed:
@"bg_photo.png"
] reflectionWithAlpha:
0.3
]];
}];
}
PS:初学者,还有很多地方不是很理解,如果有同道中人可以加QQ:45773450 以后一起讨论和研究。