java.lang.IllegalArgumentException:该组件要求您指定一个有效的android:textAppearance属性 [英] java.lang.IllegalArgumentException: This component requires that you specify a valid android:textAppearance attribute

查看:71
本文介绍了java.lang.IllegalArgumentException:该组件要求您指定一个有效的android:textAppearance属性的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的一个布局文件中有一个com.google.android.material.button.MaterialButton组件,当我使用最新版本的Material Components库(com.google.android.material:材质:1.0.0-alpha3):

I have a com.google.android.material.button.MaterialButton component in one of my layout file and I get this error when I am using the latest version of the Material Components library (com.google.android.material:material:1.0.0-alpha3):

java.lang.IllegalArgumentException:该组件要求您指定有效的android:textAppearance属性.

在1.0.0-alpha1中不存在.这是库中的错误,还是我现在应该只指定textAppearance属性?

It wasn't present in 1.0.0-alpha1. Is this a bug in the library or should I just specify a textAppearance attribute from now?

推荐答案

您的主题是否从Theme.MaterialComponents扩展?有关如何确保所有组件正常运行的更多信息,请参见 https://material.io/develop/android/docs/getting-started/

Does your theme extend from Theme.MaterialComponents? More info about how to ensure all the components will work correctly can be found at https://material.io/develop/android/docs/getting-started/

这篇关于java.lang.IllegalArgumentException:该组件要求您指定一个有效的android:textAppearance属性的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆