안드로이드

셰이프 드로어블

liufeier 2021. 10. 8. 17:49
반응형

 

새로 drawable resource file을 만듬

 

 

이름은 대충 rect_drawable.xml, selector 태그를 shape로 변경, shape="rectagnle" 속성 추가

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

    <size android:width="200dp" android:height="120dp"></size>
    <stroke android:width="1dp" android:color="#0000ff"></stroke>
    <solid android:color="#aaddff"></solid>
    <padding android:bottom="1dp"></padding>

</shape>

 

 

 

 

버튼을 추가하고, background 속성을 rect_drawable, backgroundTint를 #00000000, backgroundTintMode를 add로 하였다

반응형