【代码笔记】iOS-实现网络图片的异步加载和缓存

代码:

复制代码
- (void)viewDidLoad
{
    [super viewDidLoad];
    // Do any additional setup after loading the view.
    
    self.title=@"EGOImageViewDemo";
    
    //实现网络图片的异步加载和缓存
    EGOImageView *imageView = [[EGOImageView alloc] initWithPlaceholderImage:[UIImage imageNamed:@"1.jpg"]];
    imageView.imageURL = [NSURL URLWithString:@"http://f.dalang.gov.cn/uppic/2011-7-16/2011071610283352633.jpg"];
    imageView.frame = CGRectMake(10,100,100,100);
    [self.view addSubview:imageView];
}
复制代码

 

 

 
 
posted @ 2016-06-20 09:08  花儿迎风笑  阅读(274)  评论(0编辑  收藏  举报