Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/objective-c/22.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
iOS:使用UIBezierPath bezierPathWithOvalInRect绘制清晰的圆:_Ios_Objective C_Core Graphics - Fatal编程技术网

iOS:使用UIBezierPath bezierPathWithOvalInRect绘制清晰的圆:

iOS:使用UIBezierPath bezierPathWithOvalInRect绘制清晰的圆:,ios,objective-c,core-graphics,Ios,Objective C,Core Graphics,在我的UITableViewController单元格中,我想显示一个带数字的圆圈。我正在使用UIBezierPath的bezierpath with ovalinrect:绘制圆 不幸的是,虽然我可以将fill颜色设置为clearColor,但传递给bezierPathWithOvalInRect:的cRect中未使用的部分是黑色的 我该如何消除创建的黑色区域 部分屏幕截图供参考: (我最终希望把这个数字放在圆圈内) 代码: LTTTableViewCell: LTTDrawBallView

在我的
UITableViewController
单元格中,我想显示一个带数字的圆圈。我正在使用
UIBezierPath
bezierpath with ovalinrect:
绘制圆

不幸的是,虽然我可以将
fill
颜色设置为
clearColor
,但传递给
bezierPathWithOvalInRect:
cRect
中未使用的部分是黑色的

我该如何消除创建的黑色区域

部分屏幕截图供参考:

(我最终希望把这个数字放在圆圈内)

代码:

LTTTableViewCell: LTTDrawBallView:
在LTTDrawBallView的init方法中,包含以下代码:

self.opaque = NO;
self.backgroundColor = [UIColor clearColor];

在LTTDrawBallView的init方法中,包含以下代码:

self.opaque = NO;
self.backgroundColor = [UIColor clearColor];

也许可以将视图的
不透明
属性设置为
?我还可以想象,黑色背景不是您正在绘制的视图,而是它背后的视图。也许可以将视图的
不透明属性设置为
?我还可以想象,黑色背景不是你正在绘制的视图,而是它背后的视图。
self.opaque = NO;
self.backgroundColor = [UIColor clearColor];