Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

glide 圆角无效 #186

Open
15321657258 opened this issue Aug 31, 2018 · 6 comments
Open

glide 圆角无效 #186

15321657258 opened this issue Aug 31, 2018 · 6 comments

Comments

@15321657258
Copy link

怎么能变成圆角的?用glide设置无效,求楼主解决

@jackyHuangH
Copy link

可以设置banner的圆角,这样图片可以不用设置圆角:
/**
* 设置视图裁剪的圆角半径
* @param radius
*/
@TargetApi(Build.VERSION_CODES.LOLLIPOP)
public static void setClipViewCornerRadius(View view, final int radius){

    if(Build.VERSION.SDK_INT < Build.VERSION_CODES.LOLLIPOP){
        //不支持5.0版本以下的系统
        return;
    }

    if(view == null) return;

    if(radius <= 0){
        return;
    }
    view.setOutlineProvider(new ViewOutlineProvider() {

        @Override
        public void getOutline(View view, Outline outline) {
            outline.setRoundRect(0, 0, view.getWidth(),   view.getHeight(), radius);
        }
    });
    view.setClipToOutline(true);

}

@deerGentler
Copy link

没有搜到设置圆角的方法

@330132662
Copy link

setClipViewCornerRadius

没找到这个函数。。

@jackyHuangH
Copy link

setClipViewCornerRadius

没找到这个函数。。

你把代码复制过去,这个函数是View的

@zjianflys
Copy link

#175 (comment)

@330132662
Copy link

330132662 commented Jul 18, 2023 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants