简体   繁体   中英

How to make stroke starts outside the button - android

I got a button and I have a stroke around it. But for some reason the stroke starts inside the button not outside. How to make it outside?As you can see part of the stroke is inside the button

在此处输入图像描述

My code of the shape

<shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="rectangle" >
<stroke
    android:width="6dp"
    android:color="#39ffffff" />
    <solid
        android:color="@color/black"/>
<margin
    android:bottom="@dimen/dp12"
    android:top="@dimen/dp12"
    android:right="@dimen/dp12"
    android:left="@dimen/dp12"/>

you have a stroke for the rectangle and in addition you've a margin. try removing the margin

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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