gpt4 book ai didi

android Material 按钮无法去除圆角

转载 作者:行者123 更新时间:2023-12-04 23:47:09 25 4
gpt4 key购买 nike

我需要删除应用程序中所有按钮的圆角并使用平面背景。最好是一种颜色。
这是我的风格:

<style name="Component.MyTheme.Button" parent="Widget.MaterialComponents.Button.TextButton">
<item name="android:textColor">@color/white_50</item>
<item name="backgroundTint">@color/black</item>
<item name="cornerRadius">@null</item>
</style>
这就是我在我的主题中应用它的方式。
<item name="materialButtonStyle">@style/Component.MyTheme.Button</item>
我想改变这个
enter image description here
对此
enter image description here
编辑:忽略第二张图像两端的白条。

最佳答案

将角半径属性设置为 0dp。

app:cornerRadius="0dp"
就像下面的代码
<com.google.android.material.button.MaterialButton
android:id="@+id/button_filter_apply"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/apply"
android:fontFamily="sans-serif"
android:textAllCaps="true"
android:textColor="@color/white"
android:textStyle="bold"
app:backgroundTint="@color/clear_blue"
app:cornerRadius="0dp"
app:layout_constraintBottom_toBottomOf="parent" />
按钮看起来像
enter image description here
编辑:忽略图像两侧的黑条

关于android Material 按钮无法去除圆角,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/63317689/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com