bilibili / MagicaSakura

MagicaSakura 是 Android 多主题框架。~ is an Android multi theme library which supporting both daily colorful theme and night theme.
http://app.bilibili.com
Apache License 2.0
3.55k stars 468 forks source link

一个很奇怪的问题 #28

Closed Caij closed 7 years ago

Caij commented 7 years ago
<com.bilibili.magicasakura.widgets.TintTextView
    android:id="@+id/tv_name"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:textSize="?attr/eStatusTextSize"
    android:textColor="@color/emotion_item_tv_color_selector"/>

当textColor 设置为一个selector 然后 textSize设置主题里面的字体大小 在AppCompatCompoundDrawableHelper.loadFromAttribute 出现异常: android.content.res.Resources$NotFoundException:Resource "com.caij.emore:dimen/status_text_size_16" (7f0900b0) is not a Drawable (color or path): TypedValue{t=0x5/d=0xf01 a=5 r=0x7f0900b0}

但是不是必现的。

xyczero commented 7 years ago

AppCompatCompoundDrawableHelper内并没有解析textSize的方法 ):

Caij commented 7 years ago

@xyczero 我也看了源码 一直找不到问题的所在 所以才求助。 线上出问题还不少。

xyczero commented 7 years ago

很遗憾我在线上崩溃日志中并没有发现类似异常,建议你可以写一个demo测试一下。

Caij commented 7 years ago

好吧 主要自己没有出现这样问题 都是线上出现的 不知道什么情况下发生的。