개발/안드로이드(Android-Kotlin)

Android background radius

개복치 개발자 2019. 6. 25. 15:09

 

 안드로이드에서 뒤의 네모 박스 부분을 둥그렇게 하고 싶을 때가 있습니다.

 

 너무 간단하게 drawable 폴더에서 파일을 생성해둔 후 android:src="@drawble/****"으로 불러와주면 되는데

 

 

 

<shape
xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">

<corners android:radius="55dp" />

<solid android:color="@android:color/white" />
<stroke
android:width="10dip"
android:color="#000000" />
</shape>

 

코드를 보면

 

//얼마나 둥그렇게? 할 지 결정

<corners android:radius="55dp" />

//테두리 크기와 컬러 결정

<stroke
android:width="10dip"
android:color="#000000" />

 

 

간단합니다.

'개발 > 안드로이드(Android-Kotlin)' 카테고리의 다른 글

Retrofit, JSON, GSON, OkHttp, API 란  (0) 2019.07.31
전화하기 버튼  (0) 2019.07.25
Andorid Audio 파일 재생  (0) 2019.07.25
레이아웃 절반 등분하기  (0) 2019.06.25
Android thread  (0) 2019.06.21