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

可以指定位置设置圆角吗 #1

Open
kaioser opened this issue Dec 29, 2018 · 2 comments
Open

可以指定位置设置圆角吗 #1

kaioser opened this issue Dec 29, 2018 · 2 comments

Comments

@kaioser
Copy link

kaioser commented Dec 29, 2018

现在是没有,请教如何在代码中修改,可以指定圆角的位置,比如左上角右上角这样

@michaelxiaonull
Copy link
Owner

竟然有这个需求啊,我这边可以加的,不过这几天有事情,但保证三天内完成,你要是很急的话 可以 直接在代码里改的,在
'''

  • (UIImage *)getCornerRadiusImage {
    CGRect imageRect = _imageView.bounds;
    UIGraphicsBeginImageContextWithOptions(imageRect.size, NO, 0);
    [[UIBezierPath bezierPathWithRoundedRect:imageRect cornerRadius:_mxCornerRadius] addClip];
    [_imageView.layer renderInContext:UIGraphicsGetCurrentContext()];
    UIImage *cacheImage = UIGraphicsGetImageFromCurrentImageContext();
    UIGraphicsEndImageContext();
    return cacheImage;
    }
    '''
    [[UIBezierPath bezierPathWithRoundedRect:imageRect cornerRadius:_mxCornerRadius] addClip]; 改成[UIBezierPath bezierPathWithRoundedRect: raddi:...]有个类方法 你可以 改下哈

@kaioser
Copy link
Author

kaioser commented Dec 29, 2018

我不急,假期结束后我再调试这里,到时候再来看看,谢谢啦

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

2 participants