问题 I want to make a UIView have an effect of transparent gradient from the middle to the left and right. Like in this example: The word 籍 has the desired effect. This view is achieved by the class MarqueeLabel. I examined the source code, it is likely implemented by class CALayer . 回答1: You can use CAGradientLayer as following. gradientLayer = [CAGradientLayer layer]; gradientLayer.frame = baseView.bounds; gradientLayer.startPoint = CGPointMake(0.5,0.0); gradientLayer.endPoint = CGPointMake(0.5