首页
学习
活动
专区
工具
TVP
发布
社区首页 >问答首页 >致命异常:java.lang.UnsupportedOperationException:无法解析索引6处的属性:TypedValue {t = 0x2 / d = 0x101009b a = 1}

致命异常:java.lang.UnsupportedOperationException:无法解析索引6处的属性:TypedValue {t = 0x2 / d = 0x101009b a = 1}
EN

Stack Overflow用户
提问于 2018-12-13 05:44:18
回答 2查看 0关注 0票数 0

我在实时应用程序中看到此错误,因此我不知道为什么会发生这种情况。我只有这个异常日志(见下文)。起初,我以为我将样式editTextBackgroungWhite(见下文)应用于我的XML中的editText,但删除它对问题没有影响。

如果有人能引导我走向正确的方向,我会很高兴的。

PS我无法在我的设备上复制这个bug似乎只是一些三星音符系列设备的问题。

 <style name="editTextBackgWhite"parent="Theme.AppCompat.Light.DarkActionBar">
    <item name="colorControlNormal">#ffffff</item>
    <item name="colorControlActivated">#ffffff</item>
    <item name="colorControlHighlight">#ffffff</item>
</style>


Fatal Exception: java.lang.UnsupportedOperationException: Failed to     resolve attribute at index 6: TypedValue{t=0x2/d=0x101009b a=1}
   at android.content.res.TypedArray.getColorStateList(TypedArray.java:484)
   at android.text.style.TextAppearanceSpan.(TextAppearanceSpan.java)
   at android.text.style.TextAppearanceSpan.(TextAppearanceSpan.java)
   at android.widget.Editor$SuggestionsPopupWindow$SuggestionInfo.(Editor.java)
   at android.widget.Editor$SuggestionsPopupWindow$SuggestionInfo.(Editor.java)
   at android.widget.Editor$SuggestionsPopupWindow.initContentView(Editor.java:2995)
   at android.widget.Editor$PinnedPopupWindow.(Editor.java)
   at android.widget.Editor$SuggestionsPopupWindow.(Editor.java)
   at android.widget.Editor.showSuggestions(Editor.java:2229)
   at android.widget.Editor$2.run(Editor.java:2109)
   at android.os.Handler.handleCallback(Handler.java:739)
   at android.os.Handler.dispatchMessage(Handler.java:95)
   at android.os.Looper.loop(Looper.java:158)
   at android.app.ActivityThread.main(ActivityThread.java:7225)
   at java.lang.reflect.Method.invoke(Method.java)
   at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1230)
   at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1120)
EN

Stack Overflow用户

发布于 2018-12-13 15:36:36

尝试在您的样式中添加一些项目(AppCompat是使用> = API23编译的,使用appcompat-v7?):

<item name="colorPrimary">#2196F3</item>
<item name="colorPrimaryDark">#1565C0</item>
<item name="colorAccent">#E91E63</item>
<item name="backgroundTint">#E91E63</item> 
<item name="android:background">#FF0000</item>
<item name="android:textColorPrimary">#FFFFFF</item>

像这样:

 <style name="editTextBackgWhite"parent="Theme.AppCompat.Light.DarkActionBar">
    <item name="colorControlNormal">#ffffff</item>
    <item name="colorControlActivated">#ffffff</item>
    <item name="colorControlHighlight">#ffffff</item>
    <item name="colorPrimary">#2196F3</item>
    <item name="colorPrimaryDark">#1565C0</item>
    <item name="colorAccent">#E91E63</item>
    <item name="backgroundTint">?attr/colorAccent</item>
    <item name="android:background">#FF0000</item>
    <item name="android:textColorPrimary">#FFFFFF</item>
</style>
票数 0
EN
查看全部 2 条回答
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/-100006283

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档