我用这段代码做了一个矩形,它可以工作:
- (void)drawRect:(CGRect)rect{
CGContextRef context = UIGraphicsGetCurrentContext();
CGContextAddRect(context, CGRectMake(60, 60, 100, 1));
CGContextStrokePath(context);
}
但现在我想放一个阴影,我试过这个:
NSShadow* theShadow = [[NSShadow alloc] init];
[theShadow setShadowOffset:NSMakeSize(10.0, -10.0)];
[theShadow setShadowBlurRadius:4.0];
但是xcode告诉我 NSMakeSize : Sending 'int' to parameter of incompatible type 'CGSize'
阴影的正确形式是什么?谢谢!!