728x90
반응형
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle" >
<solid android:color="@null"/>
<corners android:bottomRightRadius="10dp"
android:bottomLeftRadius="10dp"
android:topLeftRadius="10dp"
android:topRightRadius="10dp"/>
<stroke
android:width="1dp"
android:color="#FFFFFF" />
</shape>
1. 프로젝트의 drawable 폴더 하위에 New > Drawable Resource File 선택
2. 파일명 입력 ( 여기서는 rounded_corner_shape 라고 사용 )
3. 다음과 같이 코드 입력
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle" >
<solid android:color="@null"/>
<corners android:bottomRightRadius="10dp"
android:bottomLeftRadius="10dp"
android:topLeftRadius="10dp"
android:topRightRadius="10dp"/>
<stroke
android:width="1dp"
android:color="#FFFFFF" />
</shape>
4. 적용하고자 하는 xml 파일에서 background 부분에
android:background="@drawable/rounded_corner_shape"
728x90
반응형
'Etc > android' 카테고리의 다른 글
[android] kotlin textview 외부 폰트 적용 (코드로) programmatically (0) | 2023.07.27 |
---|---|
[android] kotlin dp to pixel (textview 에 dp 적용) (0) | 2023.07.27 |
[android] 안드로이드 레이아웃 비율 설정 (layout_weight) (0) | 2023.07.14 |
[android] VCS -> git push (0) | 2023.07.05 |
[android] splash 화면 만들기 (0) | 2023.06.29 |