简体   繁体   English

Android删除按钮边框

[英]Android remove button border

i try to remove the boardes of the Button in Andorid. 我试图删除Andorid中按钮的boardes。

I know in the design i can change it with: style="?android:attr/borderlessButtonStyle" 我知道在设计中我可以改变它:style =“?android:attr / borderlessButtonStyle”

But how can i change it in the Java code or is there a soulition in the style.xml? 但是我如何在Java代码中更改它,或者在style.xml中是否存在灵魂?

try this 尝试这个

<Button
   android:background="@drawable/shape"
   android:layout_width="match_parent"
   android:layout_height="wrap_parent" />

here is shape.xml file code: 这是shape.xml文件代码:

<?xml version="1.0" encoding="UTF-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">

    <stroke android:width="1dp" android:color="#1B5E20" />
    <corners android:radius="2dp"/>
    <padding android:left="0dip" android:top="0dip" android:right="0dip" android:bottom="0dip" />
</shape>

just change shape color property like you want.. 只需改变你想要的形状颜色属性..

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM