属性引用过多警告.可能的原因?

编程入门 行业动态 更新时间:2024-10-26 00:24:19
本文介绍了属性引用过多警告.可能的原因?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我开发了一个应用程序,并注意到在logcat中收到很多属性引用过多"警告.

I developed an aplication and noticed that i get a lot of " Too many attribute references" warnings in logcat.

W/ResourceType﹕ Too many attribute references, stopped at: 0x########

我也使用support.v7.23.1.0设计库.我这样定义自己的样式:

I use support.v7.23.1.0 also design library. I define my styles like this:

<style name="AppTheme.Description.TextView" parent="@android:style/Widget.TextView"> <item name="android:textColor">@color/textColorSecondary</item> <item name="android:textColorPrimary">@color/textColorSecondary</item> <item name="android:textSize">@dimen/textSizeItemDescription</item> </style>

应用主题:

<!-- Base application theme. --> <style name="AppTheme" parent="Theme.AppCompat.Light.NoActionBar"> <!-- Customize your theme here. --> <item name="android:textColorHighlight">@color/colorPrimaryLight</item> <item name="colorPrimary">@color/colorPrimary</item> <!--status bar background color--> <item name="colorPrimaryDark">@color/colorPrimaryDark</item> <!-- color of drawer toggle and other stuff--> <item name="android:textColorSecondary">@color/textColorSecondary</item> <!-- Used to define what color preference categories titles will be--> <item name="colorAccent">@color/colorAccent</item> <!--overrides text color secondary for widgets and action mode --> <item name="colorControlNormal">@color/colorControlNormal</item> <!--when widget is activated for text writing or stuff --> <item name="colorControlActivated">@color/colorPrimaryLight</item> <!--when menu items are being Clicked --> <item name="colorControlHighlight">@color/colorPrimaryLight</item> <!--used in all areas where text color is needed (TextViews, Spinners, etc)--> <item name="android:textColor">@color/textColor</item> <!--used in text inputs like EditText--> <item name="android:textColorPrimary">@color/textColorPrimary</item> <!--main application background--> <item name="android:colorBackground">@color/colorBackground</item> <item name="drawerArrowStyle">@style/Theme.DrawerArrowStyle</item> <!--Context action meniu will overlay toolbar--> <item name="windowActionModeOverlay">true</item> <item name="toolbarStyle">@style/AppTheme.Toolbar</item> </style>

我搜索了问题,但发现的只是:

I searched the problem , but all i found is :

TextView txtView= new TextView(new ContextThemeWrapper(context, R.style.styleName));

但是我的应用程序中没有这种代码.

But I don't have that kind of code in my app.

我想知道导致此警告的原因是什么?

I wish to know what reasons can cause this warning?

更新2015-10-22 17:30 我通过更改所有自定义样式来解决了这个问题

Update 2015-10-22 17:30 I some how resolved this problem by changing all custom styles like this

<style name="AppTheme.Description.TextView" parent=""> <item name="android:textColor">@color/textColorSecondary</item> <item name="android:textColorPrimary">@color/textColorSecondary</item> <item name="android:textSize">@dimen/textSizeItemDescription</item> </style>

我的意思是我让父母空着.不确定这是好的解决方案还是坏的解决方案?

I mean i left parent empty. Not sure if this is good solution or bad ?

推荐答案

我遇到了同样的问题,并在某个时候创建​​了一个属性链.通过移除父链,链条就断了,所以你应该很好.

I had the same issue and at some point an attribute chain was created. By removing the parent the chain is broken so you should be good.

更多推荐

属性引用过多警告.可能的原因?

本文发布于:2023-11-25 12:15:56,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1629710.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:属性   原因

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!