2010-06-23 3 views
5

나는 안드로이드 드로어 블 xml의 <shape> 엘리먼트에서 사각형에 효과적으로 2 스트로크를 얻으려고합니다. 짙은 녹색의 외부 선과 밝은 녹색의 내부 선으로 그 중앙에 그라데이션 채우기가 있습니다.drawable xml 안드로이드 다중 스트로크 박스

<layer-list xmlns:android="http://schemas.android.com/apk/res/android"> 



<item> 
    <shape xmlns:android="http://schemas.android.com/apk/res/android" 
     android:shape="rectangle"> 

     <stroke android:width="3px" android:color="#477135" /> 
    </shape> 

</item> 
<item > 
    <shape xmlns:android="http://schemas.android.com/apk/res/android" 
     android:shape="rectangle"> 
     <gradient android:startColor="#81c557" android:endColor="#539942" 
      android:angle="270" /> 

     <stroke android:width="1px" android:color="#a8d78a" /> 
    </shape> 
</item> 
나는 안드로이드 적용 시도

: 상단 = "3px의"안드로이드 : 내 코드는 현재 다음과 같다 2 항목 요소에 바닥 = "3px의"를,하지만 난 오른쪽 & 왼쪽을 추가 할 때 속성을 사용하면 전체가 렌더링되지 않습니다. 참고,이 모든 ListView 내에서 이루어집니다.

답변

1

글쎄, 난 주위에 해결이 믿습니다. 그것은 꽤 aint하지만 작동합니다. 내가 한 일은 ImageView가 외곽선 색상으로 설정된 배경색을 갖도록하고, 1dip의 패딩을 준 다음, Drawable에 ImageView의 src를 설정하고 찾고 있던 효과를 얻습니다. 즉, 레이어 목록 내에서이 모든 작업을 수행하는 것을 선호합니다.