2016-06-10 5 views
0

유니버설 이미지 로더를 사용하여 이미지를로드하는 중 이상한 문제가 발생합니다. 모든 구석이 둥근 이미지를 표시하고 싶지만 출력 이미지가 요구 사항에 따라 표시되지 않습니다.유니버설 이미지 로더를 사용하는 동안 이미지 모서리가 둥글 리지 않습니다

ImageLoaderUniversal.ImageLoadWithRoundedCorners(mContext,ImageURI, mFeedIV); 

을로드 이미지 마지막 코드 - -

여기
<RelativeLayout 
    xmlns:android="http://schemas.android.com/apk/res/android" 
    android:layout_width="match_parent" 
    android:id="@+id/container_rl" 
    android:background="@color/transparent_color" 
    android:layout_height="300dp"> 

<ImageView 
    android:id="@+id/object_iv" 
    android:scaleType="fitXY" 
    android:adjustViewBounds="true" 

    android:layout_width="match_parent" 
    android:layout_height="match_parent" /> 

<View 
    android:background="@drawable/rounded_corner_bg" 
    android:layout_width="match_parent" 
    android:layout_height="match_parent"/> 

<TextView 
    android:id="@+id/name_tv" 
    android:layout_centerInParent="true" 
    android:layout_height="wrap_content" 
    android:layout_width="wrap_content" 
    android:layout_marginLeft="@dimen/space_20" 
    android:layout_marginRight="@dimen/space_20" 
    android:text="@string/app_name" 
    android:textColor="@color/white" 
    android:textSize="@dimen/size_18"/> 
</RelativeLayout> 

코드가 어댑터에 - 아래

어댑터 항목 XML 내 코드입니다

public static void ImageLoadWithRoundedCorners(Context mContext,final String URl, final ImageView imageView){ 
    DisplayImageOptions options = new DisplayImageOptions.Builder() 
      .showImageOnLoading(R.mipmap.ic_default_media) 
      .showImageForEmptyUri(R.mipmap.ic_default_media) 
      .showImageOnFail(R.mipmap.ic_default_media) 
      .cacheOnDisk(true) 
      .displayer(new RoundedBitmapDisplayer(25)) 
      .build(); 

    ImageLoaderConfiguration.Builder builder = new ImageLoaderConfiguration.Builder(mContext).defaultDisplayImageOptions(
      options).memoryCache(new WeakMemoryCache()); 
    ImageLoaderConfiguration config = builder.build(); 
    imageLoader = ImageLoader.getInstance(); 
    if (!imageLoader.isInited()) { 
     imageLoader.init(config.createDefault(mContext)); 
    } 
    imageLoader.displayImage(URl, imageView, options); 
} 

여기에 추가 위의 코드를 사용하여 이미지가 표시되는 방식을 첨부 한 scrren입니다.

내 문제에 대한 해결책을 제공해주십시오.

TIA

답변

0

이것은

options = new DisplayImageOptions.Builder() 
    .displayer(new RoundedBitmapDisplayer(50)) 
    .showStubImage(R.drawable.ic_app) 
    .showImageForEmptyUri(R.drawable.camera) 
    .showImageOnFail(R.drawable.ic_error) 
    .cacheOnDisc() 
    .build(); 
+0

이 시도 이상의 참조]을 참조로 저

ImageLoaderConfiguration config = new ImageLoaderConfiguration.Builder(thisContext) // You can pass your own memory cache implementation .discCacheFileNameGenerator(new HashCodeFileNameGenerator()) .build(); DisplayImageOptions options = new DisplayImageOptions.Builder() .displayer(new RoundedBitmapDisplayer(10)) //rounded corner bitmap .cacheInMemory(true) .cacheOnDisc(true) .build(); ImageLoader imageLoader = ImageLoader.getInstance(); imageLoader.init(config); imageLoader.displayImage(image_url,image_view, options); 

근무와 같은 결과 – Ravi

0

의존성에 컴파일 및 이미지 뷰 대신에 아래 XML 코드를 사용하십시오보십시오. 'circleimageview : de.hdodenhof 2.0.0'

컴파일

<de.hdodenhof.circleimageview.CircleImageView 
         android:id="@+id/ivUserImage_nfp" 
         android:layout_width="60dp" 
         android:layout_height="60dp" 
         android:src="@drawable/profile_img" 
         app:civ_border_color="@color/textcolor" 
         app:civ_border_width="1dp" /> 

당신이 당신의 필요에 따라 테두리 색상과 폭을 설정합니다. 유니버설 이미지 로더는 이미지로드에만 사용하십시오.

+0

내가 해달라고 완전히 둥근 이미지를 보여주고 싶습니다. 둥근 모서리 만 필요합니다. – Ravi

0

나는 다운로드 및 이미지의 모서리 라운드 유니버설 이미지 로더 라이브러리를 사용, 그것은ImageView rounded corners

관련 문제