1.我只需要做到这一点,但认为史蒂芬的解决方案将是缓慢的。这应该图形硬件。创建UIImage的类别:-(UIImage*)imageByApplyingAlpha:(CGFloat)alpha{UIGraphicsBeginImageContextWithOptions(self.size,NO,0.0f);CGContextRefctx=UIGraphicsGetCurrentContext();CGRectarea=CGRectMake(0,0,self.size.width,self.size.height);CGContextScaleCTM(ctx,1,-1);CGContextTranslateCTM(ctx,0,-area.size.height);CGContextSetBlendMode(ctx,kCGBlendModeMultiply);CGContextSetAlpha(ctx,alpha);CGContextDrawImage(ctx,area,self.CGImage);UIImage*newImage=UIGraphicsGetImageFromCurrentImageContext();UIGraphicsEndImageContext();returnnewImage;