Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/objective-c/23.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
Objective c N程序指示器-白色角_Objective C_Cocoa_Nsview_Nsprogressindicator - Fatal编程技术网

Objective c N程序指示器-白色角

Objective c N程序指示器-白色角,objective-c,cocoa,nsview,nsprogressindicator,Objective C,Cocoa,Nsview,Nsprogressindicator,我用的是白色的旋转器。请注意,这不是NSProgressIndicator的子类,而是一个自定义NSView 问题是此自定义视图的角显示为白色,而不仅仅是清晰的背景。您可以在此图像中看到: 这是我的代码: [_statusProgressIndicator setColor:[NSColor whiteColor]]; [_statusProgressIndicator setIndeterminate:YES]; [_statusProgressIndicator setBackground

我用的是白色的旋转器。请注意,这不是NSProgressIndicator的子类,而是一个自定义NSView

问题是此自定义视图的角显示为白色,而不仅仅是清晰的背景。您可以在此图像中看到:

这是我的代码:

[_statusProgressIndicator setColor:[NSColor whiteColor]];
[_statusProgressIndicator setIndeterminate:YES];
[_statusProgressIndicator setBackgroundColor:[NSColor clearColor]];
[_statusProgressIndicator setDrawsBackground:YES];
[_statusProgressIndicator startAnimation:self];
我还尝试:

[_statusProgressIndicator setDrawsBackground:NO];
但它也有同样的效果


有没有办法解决这个问题

我下载了代码并运行了示例,原始代码提供的微调器中没有圆角

我注意到在您的图像中,包含微调器的视图也有圆角?您是否使用带有
setCornerRadius:
方法的图层备份视图

如果是这样,看起来微调器子视图也具有该属性集,就像微调器和包含视图具有相同大小的圆角一样


尝试专门将微调器视图的角半径设置为0?

Hi,这很有趣。我使用MDBorderlessWindow()作为超级视图-它有:NSBezierPath*path=[NSBezierPath-bezierpath-withroundedrect:frame-xRadius:6.0 yRadius:6.0]但没有其他功能。微调器执行:[NSBezierPath fillRect:[自边界]];-我应该对此做些什么更改?在MDBorderlesSwinddow代码更改:
[NSBezierPath bezierPathWithRoundedRect:frame xRadius:6.0 yRadius:6.0]
[NSBezierPath bezierPathWithRoundedRect:self.frame xRadius:6.0 yRadius:6.0]
该函数中的
drawRect
例程实际上应该命名传入参数
rect
dirtyRect
而不是
frame
。当微调器更新且基础窗口想要更新时,它会在脏矩形中绘制圆角,而不仅仅是在实际窗口框架中。此外,在我的系统(10.9.1)中,黑色无边框窗口有白色角,它们应该是透明的,而且该窗口不能通过单击和拖动来移动。谢谢!这就解决了它:-)另外,由于添加了[self-setBackgroundColor:[NSColor clearColor]],我没有得到白色的角落;在MDBorderlessWindow.m和[self-setMovableByWindowBackground:YES]中;注意移动窗口。啊,很好,我打算建议这两件事,因为这也是我为我的圆角无标题启动屏幕所做的!很高兴我能帮忙,很高兴编码!:)