IT/안드로이드+JAVA

[안드로이드] View에 테두리 넣기 (TextView, ListView, ImageView)

안경 쓴 귀니 2016. 8. 18. 13:36
반응형



[안드로이드] View에 테두리 넣기 (TextView, ListView, ImageView)





TextView에 border 설정

<TextView android:layout_width="wrap_content" android:text="title"
 android:id="@+id/tv_st_reason" android:background="@drawable/xml_border"
 android:layout_weight="1" android:gravity="center"
 android:layout_height="fill_parent"></TextView>



/res/drawable/xml_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">
                <stroke android:width="3dp" android:color="#FF00FF00" />
                <solid android:color="#00FFFFFF" />
            </shape>
    </item>
</layer-list>



리스트뷰 간격

android:dividerHeight="5dp"


간격 색 지정

android:divider="#00ffffff"




[출처 : http://egloos.zum.com/everdream/v/5432726 ]


반응형