相关疑难解决方法(0)

将网址中的图片添加到自定义InfoWindow谷歌地图v2中

我正在使用Android应用程序.用户在谷歌地图上搜索餐馆.在谷歌地图显示所有邻居的餐厅标记.如果他点击标记,它会显示自定义InfoWindow.我的问题是我无法加载返回谷歌的图像.我正确的图像的网址,但我不能在窗口显示它.

信息窗口

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="vertical"
android:background="@color/bg_color" >

<ImageView
        android:id="@+id/place_icon"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:focusable="false"" />

<TextView
    android:id="@+id/place_title"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content" />

<TextView
    android:id="@+id/place_vicinity"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content" />

<LinearLayout 
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:orientation="horizontal"
    android:background="@color/bg_color" >

    <RatingBar
         android:id="@+id/place_rating"
         style="?android:attr/ratingBarStyleSmall"
         android:numStars="5"
         android:rating="0"
         android:isIndicator="false"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_marginLeft="5dip" />

    <ImageView
        android:id="@+id/navigate_icon"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:focusable="false"
        android:src="@drawable/navigate" />

</LinearLayout>
Run Code Online (Sandbox Code Playgroud)

在创造我有这个

mGoogleMap.setInfoWindowAdapter(new InfoWindowAdapter() {

            // Use default InfoWindow frame
            @Override
            public View getInfoWindow(Marker arg0) {
                return null;
            }

            // Defines the contents of the InfoWindow
            @Override
            public View …
Run Code Online (Sandbox Code Playgroud)

android google-maps infowindow google-maps-api-2 loadimage

18
推荐指数
3
解决办法
2万
查看次数

首先使用Picasso将图像加载到位图

我正在使用毕加索.我想先将图像添加到位图,然后将其添加到imageview.我正在使用以下代码行,使用uri从库中添加图像并在图像视图中显示它.我想先将它保存在位图上.我该怎么办:

Picasso.with(this).load(uriadress).into(imageView);
Run Code Online (Sandbox Code Playgroud)

但我想先将它保存在位图上.

android bitmap picasso

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