1 답변
-
drawable의 xml을 정의해주고 적용시켜주시면 됩니다.
res/drawable/customshape.xml
<?xml version="1.0" encoding="UTF-8"?> <shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="rectangle"> <gradient android:startColor="#SomeGradientBeginColor" android:endColor="#SomeGradientEndColor" android:angle="270"/> <corners android:bottomRightRadius="7dp" android:bottomLeftRadius="7dp" android:topLeftRadius="7dp" android:topRightRadius="7dp"/> </shape>
이렇게 정의해주시고 해당 리스트뷰에 가셔서 코드상으로는
listView.setBackgroundResource(R.drawable.customshape);
이렇게 해주시고xml에 속성을 주시고싶으시면
android:background="@drawable/customshape"
이렇게 하시면 됩니다.
댓글 입력