logo
  • 教程列表
  • SO官方文档
  • UIImage
    • 创建 UIImage
    • 比较图像
    • 颜色的渐变图像
    • 转换 UIImage tofrom base64 编码
    • 使用文件内容创建和初始化图像对象
    • 带帽的可调整图像
    • 边界的渐变背景图层
    • 拍一张 UIView 的快照
    • 将 UIColor 应用于 UIImage
    • 改变 UIImage 颜色
    • 使用 UIColor 创建 UIImage
  1. StackOverflow 文档
  2. iOS 教程
  3. UIImage
  4. 边界的渐变背景图层

边界的渐变背景图层

Created: November-22, 2018

+ (CALayer *)gradientBGLayerForBounds:(CGRect)bounds colors:(NSArray *)colors
{
    CAGradientLayer * gradientBG = [CAGradientLayer layer];
    gradientBG.frame = bounds;
    gradientBG.colors = colors;
    return gradientBG;
}
  • 拍一张 UIView 的快照
  • 带帽的可调整图像

Copyright © 2018. All right reserved

tastones.com 备案号:鲁ICP备18045372号-1

  • 关于我们
  • 免责声明