【发布时间】:2021-05-16 01:13:49
【问题描述】:
我正在努力为项目中的按钮设置正确的样式。我不知道为什么shapeAppearance 不起作用。即使我只使用cornerSize,它也不起作用。
我有一个按钮的基本样式:
<style name="SnButton" parent="Widget.MaterialComponents.Button.UnelevatedButton">
<item name="shapeAppearance">@style/MyShapeAppearance</item>
<item name="backgroundTint">@null</item>
</style>
这是我的按钮形状外观:
<style name="MyShapeAppearance" parent="ShapeAppearance.MaterialComponents.SmallComponent">
<item name="cornerFamily">rounded</item>
<item name="cornerSize">2dp</item>
</style>
这是我的基本主题:Theme.MaterialComponents.Light.NoActionBar.Bridge
我应该怎么做才能强制shapeAppearance 在我的情况下工作?或者至少cornerSize?
【问题讨论】:
标签: material-design android-button material-components-android