首页 / 浏览问题 / 移动GIS / 问题详情
Fragment加载SceneControl时报错
2EXP 2019年04月08日

SuperMap 8C IMobile 使用Fragment加载SceneControl时报错 android.view.InflateException: Binary XML file line #12: Binary XML file line #12: Error inflating class com.supermap.realspace.SceneControl,

xml文件如下

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout 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"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:background="@color/colorWhite"
    android:orientation="vertical"
    tools:context=".MainActivity">

    <com.supermap.realspace.SceneControl
        android:id="@+id/scene"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:layout_weight="1" />

    <com.esri.android.map.MapView
        android:id="@+id/map"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:layout_marginTop="1dp"
        android:layout_weight="1" />
</LinearLayout>

fragment代码如下:

@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
                         Bundle savedInstanceState) {
    // Inflate the layout for this fragment
    View view =  inflater.inflate(R.layout.activity_map_23d, container,false);//就是这行报错
    return view;
}

1个回答

你好,根据错误信息检查一下你的XML文件是否有语法错误。可以参考一下这篇文章https://www.cnblogs.com/awkflf11/p/5362927.html

9,192EXP 2019年04月08日
...