Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/google-maps/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Android ListView在MapView窗口上不工作?_Android_Google Maps_Listview_Android Listview - Fatal编程技术网

Android ListView在MapView窗口上不工作?

Android ListView在MapView窗口上不工作?,android,google-maps,listview,android-listview,Android,Google Maps,Listview,Android Listview,我正在使用MapFragment来显示Google地图。在谷歌地图上,我用一个列表视图显示自定义窗口。我已经在ListView中添加了一个视图项列表,但在此窗口中的ListView上滚动不起作用 请帮助我在我的ListView上获得滚动工作 这是我的密码: mapview.xml <fragment android:id="@+id/map" android:name="com.google.android.gms.maps.MapFragment"

我正在使用MapFragment来显示Google地图。在谷歌地图上,我用一个列表视图显示自定义窗口。我已经在ListView中添加了一个视图项列表,但在此窗口中的ListView上滚动不起作用

请帮助我在我的ListView上获得滚动工作

这是我的密码:

mapview.xml

<fragment
        android:id="@+id/map"
        android:name="com.google.android.gms.maps.MapFragment"
        android:layout_width="fill_parent"
        android:layout_height="fill_parent" />

单击地图视图上的点时,将显示listview.xml

<ListView
        android:id="@+id/mappostlistviewID"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:scrollbars="vertical"
        android:layout_margin="5dp"
        android:dividerHeight="3dp" >
    </ListView>


在列表中,我们添加了相同的项目。

您的问题可能有原因

  • 根据listView属性,您已将高度定义为包裹内容。因此,它不会滚动,而是根据添加元素的数量定义高度 为了解决这个问题,请为listview定义一些固定的高度

  • 还要确保您有足够的元素,其中总高度大于listview的定义高度

  • 尝试使用大量元素。

    请解释“滚动不起作用”?您可以查看此@davidjons yes滚动在该窗口上不起作用。如果我触摸窗口,地图视图将移动。但是列表视图不是滚动的。发布布局xmlplease@David看,我已经发布了xml文件