SimpleDraweeView圆角

//初始化圆角圆形参数对象
RoundingParams rp = new RoundingParams();
//设置图像是否为圆形
rp.setRoundAsCircle(true);
rp.setBorder(Color.RED,10);

GenericDraweeHierarchy hierarchy = GenericDraweeHierarchyBuilder.newInstance(getResources())
        //设置圆形圆角参数
        .setRoundingParams(rp)
        //设置圆角半径
        //.setRoundingParams(RoundingParams.fromCornersRadius(20))
        //分别设置左上角、右上角、左下角、右下角的圆角半径
        .setRoundingParams(RoundingParams.fromCornersRadii(20,25,30,35))
        //分别设置(前2个)左上角、(3、4)右上角、(5、6)左下角、(7、8)右下角的圆角半径
        //.setRoundingParams(RoundingParams.fromCornersRadii(new float[]{20,25,30,35,40,45,50,55}))
        //设置圆形圆角参数;RoundingParams.asCircle()是将图像设置成圆形
        //.setRoundingParams(RoundingParams.asCircle())
        //设置淡入淡出动画持续时间(单位:毫秒ms)
        .setFadeDuration(2000)
        //构建
        .build();
         view.setHierarchy(hierarchy);

你可能感兴趣的:(SimpleDraweeView圆角)