当前位置: 首页 > 工具软件 > Line View > 使用案例 >

android.view.InflateException: Binary XML file line #22: Binary XML file line错误

萧琛
2023-12-01

今天好好的项目,导过一个jar包后,就莫名其妙的报了这个错误。
rebuild ,clean 大法都没用。

布局是这样的

       <android.support.v7.widget.RecyclerView
    android:id="@+id/rv_wifi"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:paddingStart="20dp"
    android:paddingEnd="20dp"
    android:scrollbarThumbVertical="@color/toolbar_default"
    android:scrollbars="vertical"
    //app:layoutManager=".widget.MyLinearLayoutManager"
    tools:listitem="@layout/item_settings_wifi_options" />

网上查的大部分原因是因为自定义的控件,包名不对导致的。
但我这个也不是自定义,debugLog上报错提示是:
app:layoutManager=".widget.MyLinearLayoutManager"也就是上面“//”的那行。这里是直接删掉的,写个//只是为了看到。

奇怪的是,之前明明是新建到这个LayoutManager的,现在直接找不到了。

解决办法是:删除这个属性,在ACT中直接新建出来后进行setlayoutManager(new xxxx); 就OK了。
未能找出原因,仅做记录

 类似资料: