Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/powerbi/2.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 layout 如何在android线性布局中显示地图_Android Layout_Android Linearlayout_Here Api - Fatal编程技术网

Android layout 如何在android线性布局中显示地图

Android layout 如何在android线性布局中显示地图,android-layout,android-linearlayout,here-api,Android Layout,Android Linearlayout,Here Api,是否在线性布局中显示地图? 这是我的布局文件,我想在firstMap(LinearLayout)中显示地图 还要测试/检查onResume()onPause()。在本例中,使用MapView而不是MapFragment。本文档链接适用于初学者和高级用户。在本例中,使用地图视图而不是地图片段。本文档链接了starter和premium <FrameLayout xmlns:android="http://schemas.android.com/apk/res/android" xml

是否在线性布局中显示地图? 这是我的布局文件,我想在firstMap(LinearLayout)中显示地图


还要测试/检查onResume()onPause()。

在本例中,使用MapView而不是MapFragment。本文档链接适用于初学者和高级用户。

在本例中,使用地图视图而不是地图片段。本文档链接了starter和premium

<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    tools:context="com.apploft.tabs.MyTabFragment">
<RelativeLayout
    android:id="@+id/confirmed"
    android:layout_width="match_parent"
    android:layout_height="match_parent">

    <LinearLayout
        android:id="@+id/firstMap"
        android:layout_width="match_parent"
        android:layout_height="130dp"
        android:layout_alignParentTop="true"
        android:layout_centerHorizontal="true"
        android:layout_marginLeft="20dp"
        android:layout_marginRight="20dp"
        android:layout_marginTop="10dp"
        android:background="@color/cardview_shadow_start_color"
        android:orientation="horizontal">
        <!-- Map Fragment embedded with the map object -->
    </LinearLayout>
</FrameLayout>
<com.here.android.mpa.mapping.MapView
             android:id="@+id/mapview"
             android:layout_width="fill_parent"
             android:layout_height="fill_parent"
             android:visibility="visible"/>
MapView mapColView = (MapView) colTabView.findViewById(R.id.mapview);
        map = new com.here.android.mpa.mapping.Map();
        map.setCenter(new GeoCoordinate(51.509865, -0.118092, 0.0), com.here.android.mpa.mapping.Map.Animation.NONE);
        // Set the zoom level to the average between min and max
        map.setZoomLevel((map.getMaxZoomLevel() + map.getMinZoomLevel()) / 2);
        mapColView.setMap(map);