Probably the easiest way is to create a shadow, but use a light color instead of a dark one. Shadow details can be found here: How to draw a shadow under a UIView? and here .
Something like this should make the ball roll:
- (void)drawRect:(CGRect)rect { CGContextRef context = UIGraphicsGetCurrentContext(); CGContextSaveGState(context); CGContextSetShadowWithColor(context, CGSizeMake(0, 0), 10, [UIColor whiteColor].CGColor); [super drawRect:rect]; CGContextRestoreGState(context); }
Update: I just tried this. You will need to use this code to supervise the luminous view in order for it to work correctly.
e.james
source share