[英]android.view.inflateexception binary xml file line #1 error inflating class android.widget.relativeLayout
[英]android.view.InflateException: Binary XML file line #13: Error inflating class android.widget.TextView
首先,我知道那里有很多回答的问题(例如我的问题),但我根本找不到适合我的解决方案。
在手机上启动android应用时,错误会消失。 请注意,在模拟器上的工作原理很像魅力! :)
XML:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:orientation="horizontal">
<TextView
android:id="@+id/tvDepartament"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/dept_text"
android:padding="20dp"/>
<Spinner
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/dptSelect"
android:spinnerMode="dropdown"
android:clickable="true"/>
</LinearLayout>
<ListView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="@+id/contactsList"
android:layout_gravity="center_horizontal"/>
</LinearLayout>
现在,erorr日志: http ://pastebin.com/LNWauPyC
颜色: http : //pastebin.com/4SdHCgEq
问题是
颜色的代码或ID无效。
我真的明白了! 问题出在我尝试使用的自定义主题上。 我认为导致该错误的主要原因是尝试扩展Material Light,并且与我手机上的android版本不兼容! :)如果有人可以确认我会很感激的!
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.