2015-01-17 5 views
1

둥근 모양의 이미지 뷰 주위에 얇은 테두리를 추가하려고했습니다. 이렇게하려면 패딩이있는 배경을 도형을 추가하기로 결정했습니다. 결과가 좋으며, 내 이미지 뷰 주위에 얇은 경계선이 있지만이 경계선이 너무 작습니다. 3dp 주위에 테두리가 있습니다.배경 모양이 너무 작습니다.

다른 크기 (패딩, 모서리)로 재생하려고했지만 결과가 좋지 않습니다. 아마, 내 XML에 문제가있다 :

shape_rounded.xml : 여기

<stroke android:width="5dp" 
    android:color="#000000" 
    /> 

<padding android:left="3dp" 
    android:top="3dp" 
    android:right="3dp" 
    android:bottom="3dp" 
    /> 

<corners android:bottomRightRadius="30dp" android:bottomLeftRadius="30dp" 
    android:topLeftRadius="30dp" android:topRightRadius="30dp"/> 

그리고 내가 그것을 사용하는 방법입니다

<com.frisbeeeapp.frisbeee.utilities.RoundedImageView 
     android:id="@+id/img_ex" 
     android:layout_width="35dp" 
     android:layout_height="35dp" 
     android:gravity="center" 
     android:background="@drawable/shape_rounded" 
     android:scaleType="centerCrop" 
     android:src="@drawable/cover2" 
     android:layout_gravity="center_vertical" /> 
+0

, 당신은 1 픽셀의 경계를해야합니다. 이 도움이되기를 바랍니다 :) ... –

+0

둥근 이미지 뷰를 사용하기 때문에 작동하지 않습니다. – wawanopoulos

+0

획 속성의 크기를 변경하십시오. – MattMatt

답변

1

나는 그것이 지혜를 도울 것이라고 믿는다. 시간이 :

에 대해있는 LinearLayout으로 이미지 뷰를 넣고있는 LinearLayout에 패딩 = 1을 넣어 무엇을
<solid android:color="#00000000" /> 
<stroke android:width="8dp" 
     android:color="#000000"/> 
<corners android:radius="30dp" /> 
관련 문제