25
如何只为UIView的左上角和右上角设置cornerRadius?
有没有一种方法可以cornerRadius仅设置的左上角和右上角UIView? 我尝试了以下操作,但最终看不到该视图。 UIView *view = [[UIView alloc] initWithFrame:frame]; CALayer *layer = [CALayer layer]; UIBezierPath *shadowPath = [UIBezierPath bezierPathWithRoundedRect:frame byRoundingCorners:(UIRectCornerTopLeft|UIRectCornerTopRight) cornerRadii:CGSizeMake(3.0, 3.0)]; layer.shadowPath = shadowPath.CGPath; view.layer.mask = layer;