小编Kha*_*lid的帖子

objective - C:从URL加载图片?

对不起,问题标题.我找不到合适的头衔.

UITableView打开UITableView视图时没有显示来自网址的内容图像,直到图像加载并且需要时间.

我通过php从JSON获取图像.

我想显示表格然后图像加载过程.

这是我的应用程序的代码:

NSDictionary *info = [json objectAtIndex:indexPath.row];
cell.lbl.text = [info objectForKey:@"title"];
NSString *imageUrl = [info objectForKey:@"image"];
cell.img.image = [UIImage imageWithData:[NSData dataWithContentsOfURL:[NSURL URLWithString:imageUrl]]];
[cell.img.layer setBorderColor: [[UIColor blackColor] CGColor]];
[cell.img.layer setBorderWidth: 1.0];

return cell;
Run Code Online (Sandbox Code Playgroud)

抱歉,我的英语很弱.

iphone objective-c uitableview uiimageview

2
推荐指数
1
解决办法
5683
查看次数

标签 统计

iphone ×1

objective-c ×1

uiimageview ×1

uitableview ×1