重载UIView子类中的drawRect:方法,自己在drawRect:里面画倒影CGContextRef context = UIGraphicsGetCurrentContext(); UIFont *myFont = [UIFont systemFontOfSize:17]; CGContextSetShadow(context, CGSizeMake(5, 5), 2); [@"需要倒影的文字" drawAtPoint:CGPointMake(50, 50) withFont:myFont];
重载UIView子类中的drawRect:方法,自己在drawRect:里面画倒影