如何在UIView上创建投影

时间:2010-04-19 21:43:30

标签: iphone uikit uiview

我目前的代码似乎没有做任何事情:

CGContextRef currentContext = UIGraphicsGetCurrentContext();
    CGContextSaveGState(currentContext);

float myColorValues[] = {1.0, 0, 0, .8};
CGColorSpaceRef myColorSpace = CGColorSpaceCreateDeviceRGB();
CGColorRef myColor = CGColorCreate(myColorSpace, myColorValues);
CGContextSetShadowWithColor (currentContext, CGSizeMake(-1, -1), 0, myColor);

//CGContextSetShadow(currentContext, CGSizeMake(-15, 20), 15);


[super drawRect: rect];

CGContextRestoreGState(currentContext);

0 个答案:

没有答案