我正在使用所有最新的工具和 gradle 版本来具体化我的应用程序。以前,一切正常,但现在按钮样式颜色导致低于棒棒糖的版本出错。
我正在使用的父主题-
Theme.AppCompat.Light.NoActionBar
和主题中定义的颜色-
"colorPrimary", "colorPrimaryDark", "colorAccent", "colorButtonNormal", colorControlNormal", "colorControlActive", "colorControlHighlight"
这是按钮视图--
line:114 <android.support.v7.widget.AppCompatButton
android:id="@+id/act_first_lock_btn_next"
style="@style/Widget.AppCompat.Button.Colored"
android:layout_width="200dp"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:layout_marginBottom="20dp"
android:text="@string/next" />
这是奇巧4.4.4-
Caused by: android.view.InflateException: Binary XML file line #114: Error inflating class android.support.v7.widget.AppCompatButton
如果我删除样式样式="@style/Widget.AppCompat.Button.Colored",错误消失了,但按钮上没有颜色。
在发生错误之前我更改的最后一件事已更新为支持 lib 版本 23.2.0。
--更新--
这绝对是支持 lib 23.2.0 中的一个错误。这里报告的错误-https://code.google.com/p/android/issues/detail?id=201937
克里斯·贝恩斯(谷歌开发者)已将该问题合并为-
https://code.google.com/p/android/issues/detail?id=201817
尝试将style="..."
更改为android:theme="..."
我在其他机器上测试过,这是支持库版本 23.2.0 中的一个错误
所以我已经报告了AOSP 问题跟踪器在这里。
如果您遇到同样的问题...请在上面的链接上加注星标问题。
谢谢。
更新这是支持库版本 23.2.1...就像一个魅力!!
更新这是支持库 23.3.0...魅力消失了...完整的故事在这里。
我想支持库在最终发布之前需要经过良好的测试。