私はGoogle Maps Apiを使用しており、マーカーをクリックするとInfoWindow内に画像を表示したいと考えています。私はそれを実装しましたが、ピカソについては問題があります。マーカーをクリックすると、infoWindowが表示され、imageViewにプレースホルダ画像が表示されます。もう一度同じマーカーをクリックすると、ピカソはイメージを正常に読み込みます。私は2回クリックする必要があります、それはとても奇妙です。GoogleMap.InfoWindowAdapterのピカソ画像読み込みの問題
よりよく理解するためにスクリーンショット:マーカー上
まずクリック:
私はもう一度クリックしてください:
以下の私のコードがある:
InfoWindowAdapter(ここではピカソのロード)マーカー(画像のURLを渡すスニペットを使用して)
for (MediaFeedData item : mItemList) {
LatLng position = new LatLng(item.getLocation().getLatitude(),
item.getLocation().getLongitude());
mMap.addMarker(new MarkerOptions()
.snippet(item.getImages().getLowResolution().getImageUrl())
.icon(BitmapDescriptorFactory.fromResource(R.drawable.ic_point))
.position(position));
}
情報ウィンドウのレイアウトXML設定
mMap.setInfoWindowAdapter(new GoogleMap.InfoWindowAdapter() {
@Override
public View getInfoWindow(Marker marker) {
return null;
}
@Override
public View getInfoContents(Marker marker) {
View myContentsView = getLayoutInflater().inflate(R.layout.map_info_content, null);
ImageView imageView = (ImageView) myContentsView.findViewById(R.id.imgView_map_info_content);
Picasso.with(MainActivity.this)
.load(marker.getSnippet())
.placeholder(R.drawable.ic_placeholder)
.into(imageView);
return myContentsView;
}
});
は、
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<ImageView
android:id="@+id/imgView_map_info_content"
android:layout_width="match_parent"
android:layout_height="match_parent" />
</LinearLayout>
同様の問題(ツイッター用ファブリック - ピカソ)、無溶液http://stackoverflow.com/questions/32715198/fabric-twitter- do-not-download-pictures-of-tweet –
これはピカソに関するものではありません。 InfoWindowAdapterが正常に動作しない – sembozdemir