选择器怎么设置左上角右上角弧度,
liusiyuan10 opened this issue · 1 comments
liusiyuan10 commented
// // 圆角处理
// if (self.configure.indicatorCornerRadius > 0.5 * _indicatorView.SG_height) {
// _indicatorView.layer.cornerRadius = 0.5 * _indicatorView.SG_height;
// } else {
//
//// _indicatorView.layer.cornerRadius = self.configure.indicatorCornerRadius;
//
//
//// _indicatorView.layer.cornerRadius = 0.0;
//
//
// }
奇怪的是我把这段代码注释掉,只要我设置indicatorCornerRadius 这个值,它一样可以圆角,我现在是想左上角右上角是圆角,下面的不要圆角,我设置的代码没起作用,我的代码:- (void)SetcornerRadius
{
UIBezierPath *maskPath = [UIBezierPath bezierPathWithRoundedRect:self.bounds
byRoundingCorners:(UIRectCornerTopLeft|UIRectCornerTopRight)
cornerRadii:CGSizeMake(15,15)];
// Create the shape layer and set its path
CAShapeLayer *maskLayer = [CAShapeLayer layer];
maskLayer.frame = self.bounds;
maskLayer.path = maskPath.CGPath;
// Set the newly created shape layer as the mask for the image view's layer
self.layer.mask = maskLayer;
[self.layer setMasksToBounds:YES];
}
liusiyuan10 commented
这段代码是在UIView+SGPagingView这里写的,'SGPagingView' ,'1.5.3'