接收服务器上的图片,可以用webview或者 imageview

1.webview         

            UIWebView *photoWebView;

            NSURL *url =[NSURL URLWithString:urlString];

            NSURLRequest *request =[NSURLRequest requestWithURL:url];

            [photoWebView loadRequest:request];

2、uiimageview 

    NSURL *url=[NSURLURLWithString:url];

    UIImage *imagea = [UIImageimageWithData: [NSDatadataWithContentsOfURL:url]];

    UIImageView *imagh=[[UIImageView alloc] initWithImage:imagea];

    [imagh setFrame:CGRectMake(300,500,300,400)];

    [self.view addSubview:imagh];

posted @ 2012-10-08 15:32  xiaoxiaoxigua  阅读(213)  评论(0编辑  收藏  举报