선 그리기
drawable/shape_line.xml
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="line">
<stroke android:width="3dip" android:color="@color/dark_gray" />
</shape>
layout/main.xml
<View android:id="@+id/line"
android:layout_width="wrap_content" android:layout_height="10dip"
android:background="@drawable/shape_line"
/>
둥근 백그라운드 그리기
drawable/shape_white_back.xml
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<solid android:color="@color/white" />
<padding android:left="5dip" android:top="5dip"
android:right="5dip" android:bottom="5dip"
/>
<corners android:radius="4dip" />
</shape>
layout/main.xml
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent" android:layout_height="fill_parent"
android:background="@drawable/shape_white_back"
android:orientation="vertical"
android:layout_margin="30dip"
android:padding="5dip"
/>
solid : 색을 채워 넣는다.
padding : 안쪽으로 여백을 준다.
corners : 모서리를 둥글게 한다.
stroke : 테두리를 준다.
'Study > Android' 카테고리의 다른 글
[Android] ExpandableListView, SwipeListView, Swipe RecyclerView using AndroidSwipeLayout (0) | 2019.06.10 |
---|---|
[Android] 구글플레이 스토어에 등록하기 (0) | 2019.06.10 |
[android] webview bridge (0) | 2019.06.10 |
[android] map view 위에 풍선 달아주기 (0) | 2019.06.10 |
[android] Android XML parsing example (0) | 2019.06.10 |