<p><font size="3"> CAGradientLayer *gradient = [CAGradientLayer layer];</font></p>
<p><font size="3"> gradient.frame = self.view.bounds;</font></p>
<p><font size="3"> gradient.colors = [NSArray arrayWithObjects:(id)[[UIColor redColor]
CGColor], (id)[[UIColor whiteColor] CGColor], nil nil];</font></p>
<p><font size="3"> [self.view.layer insertSublayer:gradient atIndex:0];</font></p>
<p><font size="3"> 复制代码</font></p> |
|