0
我有一个我在IB中创建的视图。我的资源文件夹中有图形文件。我试图用图形填充视图作为重复的(x和y)图形(它会形成一个网格)。objective-c用图案填充视图
这里是我的代码:
-(void) awakeFromNib {
//set background patterns using, loading it through NSImage
[[NSColor colorWithPatternImage:[NSImage imageNamed:@"ts_bg_pattern.png"]] set];
NSRect splashFrame = [splashScreen frame];
//fill view with background pattern
[NSBezierPath fillRect:[splashScreen bounds]];
sleep(5);
if (splashFrame.origin.x == 0) {
[[splashScreen animator] setFrame:NSMakeRect(-1123.0, 0.0, 212.0, 612.0)];
}
}
这编译,但什么都不做。我很确定我的错误是与NSBezierPath。任何帮助,将不胜感激。
谢谢恒定。 – PruitIgoe 2011-01-12 15:36:38