프로그래밍/Android
[Android] 버튼 테두리 지정
Youngs_
2022. 7. 27. 16:49
res/drawable에 xml 파일을 만든후 아래 내용을 넣는다.
<shape xmlns:android="http://schemas.android.com/apk/res/android" >
<solid android:color="@color/white" />
<padding
android:left="10dp"
android:right="10dp"
android:bottom="10dp"
android:top="10dp"/>
<stroke
android:width="1dp"
android:color="@color/royal_blue" />
<corners
android:topLeftRadius="10dp"
android:topRightRadius="10dp"
android:bottomLeftRadius="10dp"
android:bottomRightRadius="10dp" />
</shape>
그후 테두리를 지정하고 싶은 객체에 아래와같이 배경을 지정하면 테두리가 적용된다.
android:background="@drawable/customlayout_button_main"