使用MaterialSearchView遇到android.view.InflateException解决方法
来源:互联网 发布:最霸气的纹身 知乎 编辑:程序博客网 时间:2024/06/05 09:28
前言
MaterialSearchView是一个Material风格的第三方搜索控件,本人使用的1.4.0版本。
github地址:https://github.com/MiguelCatalan/MaterialSearchView
说明
在项目中引入该库后报了以下错误:
Caused by: android.view.InflateException: Binary XML file line #41: Binary XML file line #41: Error inflating class com.miguelcatalan.materialsearchview.MaterialSearchView
本人的xml文件代码
<?xml version="1.0" encoding="utf-8"?><android.support.design.widget.CoordinatorLayout 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:fitsSystemWindows="true" tools:context="com.textbooking.textbookunlimited.ui.common.MainActivity"> <android.support.design.widget.AppBarLayout android:layout_width="match_parent" android:layout_height="wrap_content" app:elevation="0dp"> <android.support.v7.widget.Toolbar android:id="@+id/toolbar" android:layout_width="match_parent" android:layout_height="wrap_content" /> <com.miguelcatalan.materialsearchview.MaterialSearchView android:id="@+id/search_view" android:layout_width="match_parent" android:layout_height="wrap_content" /> </android.support.design.widget.AppBarLayout> <FrameLayout android:id="@+id/content" android:layout_width="match_parent" android:layout_height="match_parent" android:background="@color/gray100" app:layout_behavior="@string/appbar_scrolling_view_behavior" /> <com.aurelhubert.ahbottomnavigation.AHBottomNavigation android:id="@+id/nav" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_gravity="bottom" app:layout_anchorGravity="bottom" /></android.support.design.widget.CoordinatorLayout>
错误分析
MaterialSearchView不支持android.support.design.widget.CoordinatorLayout的父布局,父布局换成RelativeLayout后问题解决了。
0 0
- 使用MaterialSearchView遇到android.view.InflateException解决方法
- ANDROID.VIEW.INFLATEEXCEPTION解决方法
- android.view.InflateException解决方法
- Android自定义View出现android.view.InflateException的一种解决方法
- android.view.InflateException
- android.view.InflateException
- android.view.InflateException
- android.view.InflateException
- android.view.inflateexception
- android.view.InflateException
- android.view.inflateexception binary xml file line 异常的解决方法
- 使用tablayout报异常-android.view.InflateException: Binary XML file
- 自定义view时遇到的android.view.InflateException: Binary XML file问题
- android.view.inflateexception异常处理
- android.view.InflateException 异常处理
- Caused by: android.view.InflateException
- android.view.InflateException异常处理
- 解决异常“android.view.InflateException
- Python正则表达式学习(2)——字符集 [] 与 分组(capture group) ()
- 闭包经典面试题
- iptables端口映射或端口转发
- python数据库
- c语言之队列
- 使用MaterialSearchView遇到android.view.InflateException解决方法
- TCP的拥塞控制
- 我的博客即将入驻“云栖社区”,诚邀技术同仁一同入驻。
- Leetcode 389(Java)
- 比较offsetX, pageX,clientX,screenX的区别
- java四种读写方式
- mybatis generator columnRenamingRule使用
- CSS处理老式浏览器
- 你问我答-js初学者,有个问题,求大神指教。