Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/android/208.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
Java 谷歌地图中的空白方块_Java_Android_Google Maps - Fatal编程技术网

Java 谷歌地图中的空白方块

Java 谷歌地图中的空白方块,java,android,google-maps,Java,Android,Google Maps,我正在为Android 2.1编写应用程序。使用谷歌地图。除了一个细节外,一切正常:设备屏幕左下角有一个白色方形框。(如下面的屏幕截图所示)。这与我的位置无关-始终左下角为空 以下是java代码,我在其中创建mapView: mapView = new MapView(activity,"myCorrectApiCode"); // Configure the map display options mapView.setBuiltInZoomControls(false); mapView.

我正在为Android 2.1编写应用程序。使用谷歌地图。除了一个细节外,一切正常:设备屏幕左下角有一个白色方形框。(如下面的屏幕截图所示)。这与我的位置无关-始终左下角为空

以下是java代码,我在其中创建mapView:

mapView = new MapView(activity,"myCorrectApiCode");

// Configure the map display options
mapView.setBuiltInZoomControls(false);
mapView.setSatellite(true);
mapView.setStreetView(true);
有没有办法排除这个空白方块

代码详细信息: 我的主要活动xml文件:

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
    android:id="@+id/LinearLayoutMain"
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:orientation="vertical" android:layout_width="fill_parent"
android:layout_height="fill_parent" android:gravity="center">
<LinearLayout
android:background="@drawable/mapback"
android:id="@+id/LinearLayoutMainUp"
 xmlns:android="http://schemas.android.com/apk/res/android"
    android:orientation="vertical" android:layout_width="fill_parent"
    android:layout_height="80sp" android:gravity="center">
    <TextView android:textColor="#000000" android:gravity="center" android:id="@+id/TextViewResultTxt" android:layout_height="wrap_content" android:text="@string/result_txt" android:layout_width="wrap_content"></TextView>
    <TextView android:textColor="#000000" android:textStyle="bold" android:layout_height="wrap_content" android:id="@+id/myLocationText" android:singleLine="true" android:gravity="center" android:layout_width="fill_parent" android:text="@string/hello"></TextView>
    <TextView android:textColor="#000000" android:textStyle="bold" android:layout_height="wrap_content" android:id="@+id/myLocationTextDist" android:singleLine="true" android:gravity="center" android:layout_width="fill_parent" android:text="@string/waiting_for_gps"></TextView><TextView android:text="" android:id="@+id/timerTextView" android:layout_width="wrap_content" android:layout_height="wrap_content"></TextView> 
</LinearLayout>

在不了解更多信息的情况下,我首先猜测您可能在XML文件中定义了另一个MapView元素(或其他元素),该元素位于当前地图视图的顶部。如果您可以分享更多关于如何显示地图(XML和java)的信息,则更容易找到原因。

此问题取决于设备

答复如下:

摩托罗拉官方论坛发帖:

是的,据我所知,这是一些摩托罗拉手机的常见问题。如我所见,它与氰莫德有关你说得对。在其他设备(不是摩托罗拉)上,我的应用程序运行良好。谢谢你的信息。谢谢你的回复。我在它周围工作,并将MavVIEW宽度设为2×屏幕宽度(如在链接StAccOffLoFoW问题中所描述的)。
LinearLayout l = ((LinearLayout) activity.findViewById(R.id.LinearLayoutMain));
l.addView(mapView);