相关疑难解决方法(0)

Google Maps Android API v2 - 交互式InfoWindow(与原版Android谷歌地图一样)

InfoWindow点击带有新Google Maps API v2的标记后,我正在尝试制作自定义.我希望它看起来像谷歌的原始地图应用程序.像这样:

示例图像

当我在ImageButton里面时,它不起作用 - 整个InfoWindow选择而不仅仅是ImageButton.我读到这是因为它View本身没有,但它是快照,所以不能区分各个项目.

编辑:文档中(感谢Disco S2):

正如上一节关于信息窗口中所提到的,信息窗口不是实时视图,而是视图在地图上呈现为图像.因此,您在视图上设置的任何侦听器都将被忽略,并且您无法区分视图各个部分上的单击事件.建议您不要在自定义信息窗口中放置交互式组件(如按钮,复选框或文本输入).

但如果谷歌使用它,必须有一些方法来实现它.有谁有想法吗?

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

189
推荐指数
3
解决办法
12万
查看次数

自定义信息窗口适配器,具有map v2中的自定义数据

我想在android中的map v2中制作自定义信息窗口适配器,如下所示.

在此输入图像描述

我已经看到下面的链接,但没有得到更多.

1,2,3,

下面是我的内容布局文件.

<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout 
    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/infocontent_iv_image"
        android:layout_width="150dp"
        android:layout_height="150dp"
        android:layout_alignParentTop="true" 
    />
    <RelativeLayout
        android:id="@+id/infocontent_rl_middle"
        android:layout_below="@id/infocontent_iv_image"
        android:layout_width="match_parent"
        android:layout_height="wrap_content" 
        android:layout_margin="5dp"
    >

    </RelativeLayout>
    <TextView
        android:id="@+id/infocontent_tv_name"
        android:layout_below="@id/infocontent_rl_middle"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:textStyle="bold" 
        android:layout_margin="5dp"
    />
    <TextView
        android:id="@+id/infocontent_tv_type"
        android:layout_below="@id/infocontent_tv_name"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:textColor="#CCCCCC"
        android:layout_margin="5dp"
    />
    <TextView
        android:id="@+id/infocontent_tv_desc"
        android:layout_below="@id/infocontent_tv_type"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_margin="5dp"
    />
    <TextView
        android:id="@+id/infocontent_tv_addr"
        android:layout_below="@id/infocontent_tv_desc"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_margin="5dp"
    />
</RelativeLayout>
Run Code Online (Sandbox Code Playgroud)

所以任何人都可以帮助我如何将数据设置为infowindow适配器中的所有视图?

android infowindow android-maps-v2

41
推荐指数
2
解决办法
8万
查看次数