大佬教程收集整理的这篇文章主要介绍了android – 显示从互联网下载的图像作为注释 – 使用毕加索,大佬教程大佬觉得挺不错的,现在分享给大家,也给大家做个参考。
private void createAnnotation(int id,double lat,double lon,String caption,String photoUrl) { SKAnnotation Annotation = new SKAnnotation(id); SKCoordinate coordinate = new SKCoordinate(lat,lon); Annotation.setLOCATIOn(coordinatE); Annotation.setMininumZoomLevel(5); SKAnnotationView AnnotationView = new SKAnnotationView(); View customView = (LinearLayout) ((LayoutInflater) getSystemservice(Context.LAYOUT_INFLATER_serviCE)).inflate( R.layout.Annotation_photo_and_text,null,falsE); // If width and height of the view are not power of 2 the actual size of the image will be the next power of 2 of max(width,height). //AnnotationView.setView(findViewById(R.id.customView)); TextView tvCaption = (TextView) customView.findViewById(R.id.Annotation_photo_caption); tvCaption.setText(caption); ImageView ivPhoto = (ImageView) customView.findViewById(R.id.Annotation_photo); PiCasso.with(getApplicationContext()) .load(photoUrl) .resize(96,96) //.centerCrop() .into(ivPhoto); //ivPhoto.setImageresource(R.drawable.hurricanerain); AnnotationView.setView(customView); Annotation.setAnnotationView(AnnotationView); mapView.addAnnotation(Annotation,SKAnimationSetTings.ANIMATION_NONE); }
ImageView ivPhoto = (ImageView) customView.findViewById(R.id.Annotation_photo); Target target = new Target() { @Override public void onBitmapLoaded(Bitmap bitmap,PiCasso.LoadedFrom from) { ivPhoto.setImageBitmap(bitmap); AnnotationView.setView(customView); Annotation.setAnnotationView(AnnotationView); mapView.addAnnotation(Annotation,SKAnimationSetTings.ANIMATION_NONE); } @Override public void onBitmapFailed(Drawable errorDrawablE) {} @Override public void onPrepareLoad(Drawable placeHolderDrawablE) {} }; ivPhoto.setTag(target); PiCasso.with(getApplicationContext()) .load(photoUrl) .resize(96,96) .into(target);
以上是大佬教程为你收集整理的android – 显示从互联网下载的图像作为注释 – 使用毕加索全部内容,希望文章能够帮你解决android – 显示从互联网下载的图像作为注释 – 使用毕加索所遇到的程序开发问题。
如果觉得大佬教程网站内容还不错,欢迎将大佬教程推荐给程序员好友。
本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。