为了使贝塞尔曲线路径能够根据视图框架调整大小,请覆盖绘制贝塞尔曲线路径的view的drawRect:
- (void)drawRect:(CGRect)frame { UIBezierPath* rectanglePath = [UIBezierPath bezierPathWithRect: CGRectMake(CGRectGetMinX(frame), CGRectGetMinY(frame), CGRectGetWidth(frame), CGRectGetHeight(frame))]; [UIColor.grayColor setFill]; [rectanglePath fill]; }