我是一个菜鸟-一个月来学习Kotlin和android工作室( Windows 10上3.6.3版)。我正在尝试设置一个非常简单的项目,使用主题和多种小部件来试验材料设计小部件。我已经在我的styles.xml文件的开头放置了下面一行。
<style name="Theme.MyApp" parent="Theme.MaterialComponents.Light">
我从玩按钮开始,并成功地添加了一个材料设计按钮,在activity_main.xml中的样式如下:
style="@android:style/Widget.Material.Light.Button"
但是,当我添加第二个按钮时,样式为:
style="@android:style/Widget.Material.Light.Button.TextButton"
我得到了未解决的符号错误。我错过了什么或者做错了什么?
谢谢
发布于 2020-04-28 20:52:50
yes.you skip.取而代之的是
style="@android:style/Widget.Material.Light.Button"
...
style="@android:style/Widget.Material.Light.Button.TextButton"
设置如下:
style="@style/Widget.MaterialComponents.Button"
style="@style/Widget.MaterialComponents.Button.TextButton"
https://stackoverflow.com/questions/61489488
复制相似问题