사각형 레이아웃의 위, 아래에 가는 선을 넣을려고 하는 것임
|
1. border.xml 파일을 아래처럼 만든다
파일위치 : /res/drawable-hdpi/border.xml
<?xml version="1.0" encoding="utf-8"?>
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<item>
<shape android:shape="rectangle">
<solid android:color="#d7d7d7" />
</shape>
</item>
<item android:top="1dp" android:bottom="1dp">
<shape android:shape="rectangle">
<solid android:color="#ffffff" />
</shape>
</item>
</layer-list>
2. 적용할 레이아웃에 백그라운드로 적용한다.
파일위치 : /layout/activity_main.xml
<LinearLayout android:id="@+id/linear_layout5"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:background="@drawable/border"
>
위처럼 아래내용을 적용하고자 하는 레이아웃의 백그라운드에 추가해 주면 된다.
android:background="@drawable/border"
3. 끝.
'Android' 카테고리의 다른 글
안드로이드 app_name is not translated in ~~~ (0) | 2015.05.07 |
---|---|
안드로이드 네이버 밴드 공유 (0) | 2015.05.06 |
안드로이드: editText 에 포커스주고 자동으로 키보드 띄우기/숨기기 (1) | 2015.04.24 |
android null 체크, 공백체크 (0) | 2015.04.23 |
안드로이드 해상도별 아이콘 사이즈 (0) | 2015.04.21 |