gpt4 book ai didi

java - android.view.InflateException : Binary XML file line #13: Error inflating class android. widget.TextView

转载 作者:行者123 更新时间:2023-12-01 11:40:06 26 4
gpt4 key购买 nike

首先,我知道有很多已回答的问题(例如我的问题),但我根本找不到适合我的解决方案。

在手机上启动 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>

现在,错误日志: http://pastebin.com/LNWauPyC

颜色:http://pastebin.com/4SdHCgEq

最佳答案

问题是

  • 原因:java.lang.UnsupportedOperationException:无法转换为颜色:type=0x2 at android.content.res.TypedArray.getColor(TypedArray.java:326)

颜色的代码或 ID 无效。

关于java - android.view.InflateException : Binary XML file line #13: Error inflating class android. widget.TextView,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29600908/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com