iPhone的控件背景在某些时候显得单调,为此我们需要改变它.
以UIAlertView为例:
UIGraphicsBeginImageContext(theSize);
[theImage drawInRect:CGRectMake(0, 0, theSize.width, theSize.height)];
theImage = UIGraphicsGetImageFromCurrentImageContext();
UIGraphicsEndImageContext();
theAlert.layer.contents = (id)[theImage CGImage];
并添加QuartzCore引用.