Inflater在某些Android L设备上失败 - NotFoundException - 将drawable与其他类型混合

时间:2014-11-06 18:15:31

标签: android-layout android-5.0-lollipop

知道什么可能导致此错误:

android.view.InflateException: Binary XML file line #3: Error inflating class net.ebt.appswitch.view.AppIconView
       at android.view.LayoutInflater.createView(LayoutInflater.java:629)
       at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:739)
       at android.view.LayoutInflater.inflate(LayoutInflater.java:478)
       at android.view.LayoutInflater.inflate(LayoutInflater.java:410)
       ...
Caused by: android.content.res.Resources$NotFoundException: Resource "android:style/TextAppearance.MisspelledSuggestion" (10302fd)  is not a Drawable (color or path): TypedValue{t=0x1/d=0x10302fd a=1 r=0x10302fd}
       at android.content.res.Resources.loadDrawableForCookie(Resources.java:2325)
       at android.content.res.Resources.loadDrawable(Resources.java:2265)
       at android.content.res.TypedArray.getDrawable(TypedArray.java:743)
       at android.view.View.(View.java:3693)
       at android.view.ViewGroup.(ViewGroup.java:487)
       at android.widget.FrameLayout.(FrameLayout.java:105)
       at android.widget.FrameLayout.(FrameLayout.java:101)
       at android.widget.FrameLayout.(FrameLayout.java:97)
       ...

我没有在任何资源中使用TextAppearance.MisspelledSuggestion。 仅在L 上发生。

这里布局:

<x.x.x.MyCustomViewExtendsFrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:background="?android:selectableItemBackgroundBorderless"
    android:clipToPadding="true"
    android:layout_marginTop="10dp"
    android:paddingTop="10dp">

    <LinearLayout
        android:id="@+id/icon_container"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:orientation="vertical">

        <ImageView
            android:id="@+id/app_icon"
            android:layout_width="@dimen/icon"
            android:layout_height="@dimen/icon"
            android:layout_gravity="center" />

        <TextView
            style="@style/MyAppTheme.TextAppearance.Black.Shadow"
            android:id="@+id/app_name"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_gravity="center_horizontal"
            android:ellipsize="end"
            android:gravity="center"
            android:maxLines="1"
            android:paddingLeft="@dimen/icon_padding"
            android:paddingRight="@dimen/icon_padding"
            android:textColor="@android:color/white"
            android:textSize="@dimen/icon_text_size"
            android:visibility="visible" />
    </LinearLayout>

    <TextView
        android:id="@+id/app_picto"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:textSize="@dimen/icon_badge_size" />

    <TextView
        android:id="@+id/app_pin"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:alpha="0.7"
        android:padding="5dp"
        android:textSize="@dimen/icon_badge_size" />

</x.x.x.MyCustomViewExtendsFrameLayout>

由于

0 个答案:

没有答案