【发布时间】:2017-11-08 17:49:18
【问题描述】:
我正在使用以下方法来圆化 uitextfield 的特定角。但是,它具有擦除圆角边框的效果。任何人都可以建议在不删除边界的情况下做到这一点吗?提前感谢您的任何建议。
-(void)roundBottomCornersOfView: (UITextField*) view by: (NSInteger) radius {
CGRect rect = view.bounds;
UIBezierPath *path = [UIBezierPath bezierPathWithRoundedRect:rect
byRoundingCorners:UIRectCornerTopLeft |UIRectCornerTopRight
cornerRadii:CGSizeMake(radius, radius)];
CAShapeLayer *layers = [CAShapeLayer layer];
layers.frame = rect;
layers.path = path.CGPath;
view.layer.mask = layers;
}
【问题讨论】:
标签: ios objective-c uitextfield rounded-corners