반응형
[Android] 레이아웃 boder, background, radius 적용
- drawable에 xml 생성
boder
<?xml version="1.0" encoding="utf-8"?>
<!-- drawable/border-->
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<item>
<shape android:shape="rectangle">
<solid android:color="#FF0000" />
</shape>
</item>
<item
android:bottom="1dp"
android:top="1dp"
android:left="1dp"
android:right="1dp"
>
<shape android:shape="rectangle">
<solid android:color="#ffffff" />
</shape>
</item>
</layer-list>
radius
<?xml version="1.0" encoding="utf-8"?>
<!--drawable/radius-->
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:padding="10dp"
android:shape="rectangle" >
<solid android:color="#FFF" />
<!--radius-->
<corners
android:bottomLeftRadius="20dp"
android:bottomRightRadius="20dp"
android:topLeftRadius="20dp"
android:topRightRadius="20dp" />
<!--border-->
<stroke
android:width="2dp"
android:color="#FF0000" />
</shape>
적용
- View XML에 추가
<!-- android:background="@drawable/파일이름" -->
android:background="@drawable/background"
반응형
'Programming > Kotlin (Android)' 카테고리의 다른 글
[Kotlin] Int 형으로 변환 / Any형, String등 형변환 (0) | 2020.06.08 |
---|---|
[Android] 안드로이드 스튜디오 Vector Asset icon 사용 (0) | 2020.06.02 |
[Kotlin] 상속, 오버라이딩, 추상화 (0) | 2020.04.25 |
[Kotlin] 조건문, 반복문 (0) | 2020.04.25 |
[Kotlin] 형 변환 (0) | 2020.04.25 |
댓글