gpt4 book ai didi

iphone - 无法绘制 bezierPath

转载 作者:行者123 更新时间:2023-11-29 11:05:42 25 4
gpt4 key购买 nike

我将以下代码放在 UIViewController 中:

- (void)drawRect:(CGRect)rect {
UIBezierPath *trackPath = [UIBezierPath bezierPath];
[trackPath addQuadCurveToPoint:CGPointMake(10, 30) controlPoint:CGPointMake(0, 0)];
trackPath.lineWidth = 2;
[trackPath fill];
[trackPath stroke];
}

但是,我没有看到路径。我做错了什么?

最佳答案

UIViewController 没有实现 drawRect:。您需要在 UIView 子类中覆盖该方法。此外,您可能想要为贝塞尔曲线路径设置颜色。

关于iphone - 无法绘制 bezierPath,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13714866/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com