【发布时间】:2015-10-02 14:34:05
【问题描述】:
我想实现一个具有 MapView 和 NavigationView 的布局,下面是我按照this 教程尝试的。我收到此错误android.view.InflateException: Binary XML file line #43: Error inflating class fragmen 出了什么问题?
<android.support.v4.widget.DrawerLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
tools:context=".ShopsCatalogActivityUsingMapView"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:id="@+id/drawer"
android:fitsSystemWindows="true">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
<!--toolbar-->
<include
android:id="@+id/tool_bar"
layout="@layout/tool_bar">
</include>
<!--map-->
<FrameLayout
android:id="@+id/frame"
android:layout_width="match_parent"
android:layout_height="match_parent">
<!--map-->
<fragment xmlns:map="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/map"
android:name="com.google.android.gms.maps.SupportMapFragment"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".CustomInfo" />
</FrameLayout>
</LinearLayout>
<!--navigation drawer-->
<android.support.design.widget.NavigationView
android:id="@+id/my_navigation_view"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_gravity="start"
app:headerLayout="@layout/navigation_view_header"
app:menu="@menu/navigation_drawer_menu" />
</android.support.v4.widget.DrawerLayout>
第 43 行是包含地图的片段
【问题讨论】:
-
这是您的整个 XML 文件吗?那些需要包装在抽屉布局中
-
贴出整个布局文件,#43是哪一行?
标签: android android-fragments fragment android-inflate