为什么NSImage在NSCell of NSTableView中乱画。以及如何正确地纠正这种行为。我从数据源方法返回图像:
- (id)tableView:(NSTableView *)tableView objectValueForTableColumn:(NSTableColumn *)tableColumn row:(NSInteger)row {
return [NSImage imageNamed: @"test.png"];
}作为解决办法,我试过:
[NSImage setFlipped:NO];一切正常,但正如文档所述,它不推荐使用方法。
osx 10.7-10.9
发布于 2014-03-27 09:35:45
我通过替换从以下位置获取图像的代码来解决问题:
return [NSImage imageNamed: @"test.png"];至:
NSData * imageData = [NSData dataWithContentsOfFile: [[NSBundle mainBundle] pathForImageResource: test.png]];
return [[NSImage alloc] initWithDataIgnoringOrientation:imageData];我不知道这种行为和文件的原因,我什么也不知道。但如果你解释我的话我会很高兴的。
发布于 2014-02-04 15:51:15
这里是我刚发现的一些信息。
基本上,根据链接,您必须:
https://stackoverflow.com/questions/21553627
复制相似问题