标签:
/// <summary> /// 异步获取文件流 /// </summary> /// <param name="url"></param> /// <returns></returns> public async Task<Stream> GetFileStreamAsync(string url) { try { System.Net.Http.HttpClient client = new System.Net.Http.HttpClient(); var fileStream = await client.GetStreamAsync(url); return fileStream; } catch (Exception ex) { throw new WebServiceException(ex.Message); } }
private async void SetImage(string url) {var stream = await GetFileStreamAsync(url); var imageView = FindViewById<ImageView>(Resource.Id.iv_userphoto_mycenter_myprofile); imageView.SetImageBitmap(BitmapFactory.DecodeStream(stream)); }
xamarin.Android ImageView 异步加载网络图片
标签:
原文地址:http://www.cnblogs.com/mycing/p/5557050.html