删除边框我有这个按钮:从无边距按钮
<Button
android:id="@+id/btn_action"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentEnd="true"
android:layout_alignParentRight="true"
android:theme="@style/AppTheme.Button.Toolbar"/>
而且这一款式:
<style name="AppTheme.Button.Toolbar" parent="Widget.AppCompat.Button.Borderless">
<item name="colorButtonNormal">@color/main</item>
<item name="android:textColor">@color/secondary</item>
</style>
即使风格从Widget.AppCompat.Button.Borderless
继承,按钮仍然具有边框。
将Button
更改为android.support.v7.widget.AppCompatButton
没有帮助。
如何删除边框呢?
编辑:按钮的
设置的背景是不是一种选择 - 这样做的连锁反应动画丢失。
编辑2:
事情变得更有趣。
试图改变android:theme
为style
,因为@cadet建议。
当按钮被这样定义的:
<Button
android:id="@+id/btn_action"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentEnd="true"
android:layout_alignParentRight="true"
android:theme="@style/ToolbarButton"/>
这就是我得到:
颜色适用,但有明显的边框。
如果我只是改变主题风格:
<Button
android:id="@+id/btn_action"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentEnd="true"
android:layout_alignParentRight="true"
style="@style/ToolbarButton"/>
我得到这个:
没有边框,风格只是部分应用(文本颜色,按钮不是)
编辑3:
朋友们,我正在寻找一种方法来获得无边界,使用造型方法涟漪效应风格的按钮。在布局文件中分别对每个按钮分别进行操作可能会奏效,但这不是重点。
This! @NileshRathod是正确的 – Grisgram
@容易检查我的答案,我认为它可能会指出你在正确的方向。我想你想使用可绘制的波纹和无边框按钮的组合来达到预期的效果。 –
@韦德威尔逊,我看不到你的答案。你删除了吗? – Vasiliy