여기 내 UIView의 둥근 모서리 스타일을 사용하려면, 그리고 내 코드입니다 :UIView의 TopLeft 및 TopRight 모서리를 둥근 모서리로 변경하는 방법은 무엇입니까?
UIBezierPath *maskPath1 = [UIBezierPath bezierPathWithRoundedRect:self.styleView1.bounds
byRoundingCorners:UIRectCornerTopLeft | UIRectCornerTopRight
cornerRadii:CGSizeMake(4, 4)];
CAShapeLayer *maskLayer1 = [[CAShapeLayer alloc] init];
maskLayer1.frame = self.styleView1.bounds;
maskLayer1.path = maskPath1.CGPath;
self.styleView1.layer.borderWidth = 1;
[self.styleView1.layer setBorderColor:[[UIColor lightGrayColor] CGColor]];
self.styleView1.layer.mask = maskLayer1;
효과는 같다 :
포토샵 깃털 효과처럼 코너에 비어 있습니다 .
어떻게 일어날 수 있도록 :
는하지만 내가 원하는 것은이 무엇입니까?
그냥 'TopLeft'와'TopRight'를 모서리를 둥글게해서이 두 스레드가 제 질문에 어울리지 않을 수 있도록 설정하고 싶습니다. –
@Don_Chen 시도 (http://stackoverflow.com/questions/25616382/how-to-set-cornerradius-for-only-bottom-left-bottom-right-and-top-left-corner-of) 및 (http://stackoverflow.com/questions/10167266/how-to-set-cornerradius-for-only-top-left-and-top-right-corner-of-a-uiview) –