SimpleDraweeView 设置圆角不生效问题
采用的是xml配置 roundedCornerRadius 参数方法
adverPic.setImageURI("http://xx.xx.xx.xx/123.jpg");
设置control 也无效。
解决办法:
RoundingParams roundingParams = new RoundingParams(); roundingParams.setCornersRadius(ScreenUtil.dpToPx(getResources(),15)); GenericDraweeHierarchyBuilder builder = new GenericDraweeHierarchyBuilder(getResources()); GenericDraweeHierarchy hierarchy = builder.build(); hierarchy.setRoundingParams(roundingParams); adverPic.setImageURI(GlobalParams.gInitInfoEntity.getModel().getImage_url() + adverEntity.getImage_url()); adverPic.setHierarchy(hierarchy);
<com.facebook.drawee.view.SimpleDraweeView android:id="@+id/img_ad_pic" android:layout_width="80dp" android:layout_height="80dp" android:layout_marginRight="6dp" />