在Android中,布局有时隐藏在mapview下
我正在点击mapview显示自定义视图。该视图位于另一个xml布局文件中,该布局文件包含在地图视图所在的xml布局中 例如,自定义视图文件为map_tool_tip.xml,地图屏幕为mapscreen.xml。在mapscreen.xml中,代码编写如下:在Android中,布局有时隐藏在mapview下,android,view,hide,android-mapview,Android,View,Hide,Android Mapview,我正在点击mapview显示自定义视图。该视图位于另一个xml布局文件中,该布局文件包含在地图视图所在的xml布局中 例如,自定义视图文件为map_tool_tip.xml,地图屏幕为mapscreen.xml。在mapscreen.xml中,代码编写如下: <RelativeLayout android:layout_width = "fill_parent" android:layout_height = "fill_parent"> <com.g
<RelativeLayout
android:layout_width = "fill_parent"
android:layout_height = "fill_parent">
<com.google.android.maps.MapView
android:id="@+id/mapview"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:enabled="true"
android:clickable="true"
android:apiKey="05HCG9bJJ4yk-8qGcV1_LoEI4J499NRLnkQIIlQ"
/>
<include android:id="@+id/layoutMapToolTip"
layout="@layout/map_tool_tip"
android:layout_centerInParent="true"
android:layout_marginLeft="15dp"
android:layout_marginTop="50dp"
android:layout_marginRight="15dp"
android:layout_marginBottom="30dp"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
/>
</RelativeLayout>
布局工具提示可见性设置为“消失”,仅在点击时更改。现在,有时发生的情况是,工具提示永远看不见。我猜,它在地图视图下。我不确定是什么问题。但它并不是每次都发生,但确实发生了
工具提示不可见的问题是什么?解决方法是什么?您确定您的onTap方法只被调用一次吗?我猜有时候你的手机会发送两个onTap事件,而你只需要一个。不确定。是的,它会被调用一次。双击时,地图将放大。所以这并没有发生,而且只调用了一次。我想有时候发生的事情是layoutMapToolTip布局在mapview后面。无论如何,这是可以预防的吗?